I'm trying to test my Xamarin.Forms app with Xamarin.UITest. Android works fine, but the iOS part has problems. When executing my first test to get into REPL I get the following error:
SetUp : System.Exception : Unable to contact test backend running in app. A common cause is that the app is not properly linked with Calabash. Please verify that it includes the Calabash component.
The strange thing is, when uploading the app to the Microsoft App Center it starts a test. It just hangs because it fails to find my toolbaritems. I wanted to check for a valid query with REPL by doing the iOS test on my Mac, while I'm usually working on Visual Studio on Windows.
I tried the solutions I found online with no luck
- My .iOS project includes the Xamarin.TestCloud.Agent
- In the AppDelegate.cs I have Xamarin.Calabash.Start() directly after global::Xamarin.Forms.Forms.Init().
- I have NUnit 2.6.4 and NUnitTestAdapter 2.1.1 in the UITest project
- I am using my Debug/IPhoneSimulator configuration
I am compiling an .app file from Visual Studio on Windows connected to a Mac and start the iOS test on the Mac.
This is my current code for the AppInitializer:
return ConfigureApp.iOS.AppBundle(sPathToiOS).PreferIdeSettings().StartApp();
Sometimes I also get a different error:
SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to contact DeviceAgent
----> System.AggregateException : One or more errors occurred.
----> Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to contact DeviceAgent on 127.0.0.1
----> System.Net.Http.HttpRequestException : An error occurred while sending the request
----> System.Net.WebException : Error: ConnectFailure (Connection refused)
----> System.Net.Sockets.SocketException : Connection refused
This seems to be happening when the simulator is not running when starting the test and it takes to long to start the simulator.