Xamarin UI Test iOS Simulator Connection refused

1.3k Views Asked by At

I am trying to use Xamarin.UITest locally, but I am getting a httprequest exception, saying that the connection has been refused I am using xcode 9.3, vs 7.4.2 and an iphone 10.3 iphone x sim Xamarin.Ui.Test 2.2.4, Xamarin.Testcloud.Agent 0.21.4, NUnit 3.10.1 When Trying to run my test I get the following Exception:

Xamarin.UITest.XDB.Exceptions.DeviceAgentException : DeviceAgent start session failed: An error occurred while sending the request ----> System.Net.Http.HttpRequestException : An error occurred while sending the request ----> System.Net.WebException : Error: ConnectFailure (Connection refused) ----> System.Net.Sockets.SocketException : Connection refused

2

There are 2 best solutions below

1
hot33331 On BEST ANSWER

I got it working by restarting the mac and putting the Calabash.Start() call right on top of the FinishedLaunching method. If one or both saved the day, I don't know.

0
ClaudiuC_MSFT On

Although it's an old post, others might look for it. That error means that the simulator doesn't start quickly enough for the next test.

There is an active bug opened here https://github.com/Microsoft/appcenter/issues/340#

What you can do is either set the variable to 0 and manually restart the emulator to pick the new code.

Also, be sure that NUnit package version is max 2.6.x. Newest 3.0 is not supported by Xamarin.UITest