Forum Xamarin Xamarin.Forms

Underlying connection closed error when running UI Tests

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()
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)

Xamarin ([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 (HEAD/a8a3b0ec7)
Xamarin.Android Reference Assemblies and MSBuild support.

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

Andriod SDK 8.1 Oreo, Platform 27
Visual Studio 15.8.4



  • 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.