Underlying connection closed error when running UI Tests

SantoshThapaSantoshThapa ✭✭USMember ✭✭

SetUp : System.Net.Http.HttpRequestException : An error occurred while sending the request.
----> System.Net.WebException : The underlying connection was closed: The connection was closed unexpectedly.
at Xamarin.UITest.Shared.Http.HttpClient.SendData(String endpoint, String method, HttpContent content, ExceptionPolicy exceptionPolicy, Nullable1 timeOut) at Xamarin.UITest.Shared.Http.HttpClient.Post(String endpoint, String arguments, ExceptionPolicy exceptionPolicy, Nullable1 timeOut)
at Xamarin.UITest.Shared.Android.HttpApplicationStarter.Execute(String intentJson)
at Xamarin.UITest.Shared.Android.LocalAndroidAppLifeCycle.LaunchApp(String appPackageName, ApkFile testServerApkFile, Int32 testServerPort)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration, IExecutor executor)
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp(AppDataMode appDataMode)
at Elog.UITest.Regression59.BeforeEachTest()
--WebException
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

ENV:
Xamarin 4.11.0.776 ([email protected])
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 4.15.9 (d000f568b)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 1.1.116 (9619170)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 9.0.0.19 (HEAD/a8a3b0ec7)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 12.0.0.15 (84552a4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Andriod SDK 8.1 Oreo, Platform 27
Visual Studio 15.8.4

Tagged:

Answers

  • ShantimohanElchuriShantimohanElchuri ✭✭✭✭✭ USMember ✭✭✭✭✭

    It appears your internet connection is broken. Did you try rerunning it?

  • SantoshThapaSantoshThapa ✭✭ USMember ✭✭

    Yeah, my machine wasn't able to communicate with my tablet properly. Initially it pointed me towards ADB issues. But later, it seems like i had an issue with Mono Shared Runtime and Xamarin Android API-27 Support, which was blocking any singed apk to run through ADB. After uninstalling them, it appears to be working fine.

Sign In or Register to comment.