Forum Visual Studio
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Running UI test from Visual Studio sometimes fails with error: OneTimeSetUp: System.Exception

SeanConlonSeanConlon USMember ✭✭

My visual studio project runs tests on iOS simulators & Android emulators.
When I test on an iOS simulator usually the first test runs OK. The second test, though, could fail with the following error:

OneTimeSetUp: System.Exception : Error while performing Query(null)
----> System.AggregateException : One or more errors occurred. (DeviceAgent springboard-dismiss-alerts failed: An error occurred while sending the request.)
----> Xamarin.UITest.XDB.Exceptions.DeviceAgentException : DeviceAgent springboard-dismiss-alerts failed: An error occurred while sending the request.
----> System.Net.Http.HttpRequestException : An error occurred while sending the request.
----> System.IO.IOException : Unable to write data to the transport connection: The socket has been shut down.
----> System.Net.Sockets.SocketException : The socket has been shut down

The 3rd test will probably run ok and so on... Eventually another test will fail with the above error. But if I try it again, it will probably work.
Has anyone any idea why this happens? And, more importantly, how I can make sure it does'nt happen again.

My specs:
VS2019 for MAC: 8.4.2
Xamarin UI Test: 3.0.5
Nunit: 3.12.0
NUnit3TestAdapter: 3.15.1

Thanks

Sign In or Register to comment.