Xamarin UITest - Android - REPL - SocketException

Barry M Culhane 1 Reputation point

I'm having trouble running Xamarin Forms UI Tests against Android, using Visual Studio 2019 v16.9.3

My UI tests execute without issue, but the REPL tool isn't working correctly - when I issue a query command like TREE, I get this exception...

Execution failed with exception: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it
at System.Net.Sockets.Socket.InternalEndConnect(IAsyncResult asyncResult)
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
at Xamarin.UITest.Shared.Http.HttpClient.Request(String method, String endpoint, ExceptionPolicy exceptionPolicy, Nullable1 timeOut) at Xamarin.UITest.Android.AndroidGestures.Dump() at Xamarin.UITest.Utils.TreePrintHelper.PrintTree(ITreePrinter treePrinter) at Xamarin.UITest.Queries.AppPrintHelper.Tree(Nullable1 console)
at <InteractiveExpressionClass>.Host(Object& $retval)
at Mono.CSharp.Evaluator.Evaluate(String input, Object& result, Boolean& result_set)
at Xamarin.UITest.Repl.Evaluation.MonoCSharpReplEngine.Evaluate(String line)
at Xamarin.UITest.Repl.PromptHandler.PrintTree()
at Xamarin.UITest.Repl.PromptHandler.HandleInput(ConsoleKeyInfo key)
at Xamarin.UITest.Repl.Program.Main(String[] args)

I've tried 5 different Android emulator devices, but the error is the same on each one. I've disabled Windows Firewall - makes no difference. What could be causing this?

I'm using NUnit3TestAdapter v3.17.0 , NUnit 3.13.1 and Xamarin.UITest 3.0.11 - I've tried every version of UITest from 3.0.7 through 3.0.15 but the result is identical.

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,809 questions
{count} votes