Xamarin UITest REPL 树“无法连接”

问题描述

我有一个带有 UITests 的 Xamarin Android 应用程序。这些测试对我团队的其他成员运行良好,但对我来说总是失败。我收到这条消息:

System.Exception : Error while performing Query(Marked("edtLogin"))
      ----> 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 127.0.0.1:60757

如果我在此之前尝试做一个 repl 树,我会得到同样的错误。我在硬件上运行(没有模拟器)。在 2 台设备上尝试了相同的结果(Zebra TC75 和三星 S9+)

编辑: 日志到此结束

18-05-2021 10:25:45.355 -04:00 - 124748 - HTTP POST { Url: { AbsolutePath: "/map",AbsoluteUri: "http://127.0.0.1:60757/map",LocalPath: "/map",Authority: "127.0.0.1:60757",HostNameType: IPv4,IsDefaultPort: False,IsFile: False,IsLoopback: True,PathAndQuery: "/map",Segments: [ "/","map" ],IsUnc: False,Host: "127.0.0.1",Port: 60757,Query: "",Fragment: "",Scheme: "http",OriginalString: "http://127.0.0.1:60757/map",DnsSafeHost: "127.0.0.1",IdnHost: "127.0.0.1",IsAbsoluteUri: True,UserEscaped: False,UserInfo: "" } }
18-05-2021 10:25:45.475 -04:00 - 124868 - POST Complete { StatusCode: OK,StatusDescription: "OK ",ResponseHeaders: "Date: Mon,17 May 2021 14:25:03 GMT
",Contents: "{"results":[{"class":"androidx.appcompat.widget.AppCompatEditText","tag":null,"description":"androidx.appcompat.widget.AppCompatEditText{977d47b VFED..CL. .F...... 0,0-536,91 #7f0e0529 app:id/edtLogin}","id":"edtLogin","text":"","visible":true,"rect":{"height":91,"width":536,"y":609,"x":92,"center_x":360,"center_y":654},"enabled":true,"contentDescription":null}],"outcome":"SUCCESS"}" }
18-05-2021 10:25:45.477 -04:00 - 124870 - HTTP POST { Url: { AbsolutePath: "/map",UserInfo: "" } }
18-05-2021 10:25:45.585 -04:00 - 124977 - POST Complete { StatusCode: OK,"outcome":"SUCCESS"}" }
18-05-2021 10:25:45.737 -04:00 - 125129 - Using element matching Id("edtLogin").
18-05-2021 10:25:45.737 -04:00 - 125129 - Tapping coordinates [ 360,654 ].
18-05-2021 10:25:45.738 -04:00 - 125130 - HTTP POST { Url: { AbsolutePath: "/",AbsoluteUri: "http://127.0.0.1:60757/",LocalPath: "/",PathAndQuery: "/",Segments: [ "/" ],OriginalString: "http://127.0.0.1:60757/",UserInfo: "" } }
18-05-2021 10:25:46.408 -04:00 - 125800 - POST Complete { StatusCode: OK,17 May 2021 14:25:04 GMT
",Contents: "{"bonusinformation":[],"message":"","success":true}" }
18-05-2021 10:25:46.416 -04:00 - 125809 - Potential Android SDK location: C:\Program Files (x86)\Android\android-sdk - Valid SDK. [ Source: ANDROID_HOME ]
18-05-2021 10:25:46.417 -04:00 - 125809 - Using Android SDK: C:\Program Files (x86)\Android\android-sdk
18-05-2021 10:26:06.612 -04:00 - 146004 - HTTP POST { Url: { AbsolutePath: "/map",UserInfo: "" } }
18-05-2021 10:26:10.724 -04:00 - 150116 - HTTP POST { Url: { AbsolutePath: "/map",UserInfo: "" } }
18-05-2021 10:26:12.772 -04:00 - 152164 - Error while performing Query(Marked("edtLogin"))
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 127.0.0.1:60757
   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.EndGetRequestStream(IAsyncResult asyncResult,TransportContext& context)
   at System.Net.Http.httpclienthandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at Xamarin.UITest.Shared.Http.HttpClient.SendData(String endpoint,String method,HttpContent content,ExceptionPolicy exceptionPolicy,Nullable`1 timeOut)
   at Xamarin.UITest.Shared.Http.HttpClient.Post(String endpoint,String arguments,Nullable`1 timeOut)
   at Xamarin.UITest.Android.AndroidGestures.Query[T](ITokenContainer query,Object[] args,String methodName)
   at Xamarin.UITest.Android.AndroidGestures.Query(AppQuery query)
   at Xamarin.UITest.Android.AndroidApp.<>c__displayClass12_0.<Query>b__0()
   at Xamarin.UITest.Utils.ErrorReporting.With[T](Func`1 func,String memberName)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...