Sta*_*mpi 3 ios xamarin xamarin.forms xamarin.uitest visual-studio-mac
我正在尝试使用 Xamarin.UITest 测试我的 Xamarin.Forms 应用程序。Android 运行良好,但 iOS 部分存在问题。当执行第一个进入 REPL 的测试时,我收到以下错误:
SetUp : System.Exception : Unable to contact test backend running in app. A common cause is that the app is not properly linked with Calabash. Please verify that it includes the Calabash component.
Run Code Online (Sandbox Code Playgroud)
奇怪的是,当将应用程序上传到 Microsoft 应用程序中心时,它会开始测试。它只是挂起,因为它找不到我的工具栏项。我想通过在 Mac 上进行 iOS 测试来检查 REPL 的有效查询,而我通常在 Windows 上使用 Visual Studio。
我尝试了网上找到的解决方案,但没有成功
我正在从连接到 Mac 的 Windows 上的 Visual Studio 编译 .app 文件,并在 Mac 上启动 iOS 测试。
这是我当前的 AppInitializer 代码:
return ConfigureApp.iOS.AppBundle(sPathToiOS).PreferIdeSettings().StartApp();
Run Code Online (Sandbox Code Playgroud)
有时我也会收到不同的错误:
SetUp : Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to contact DeviceAgent
----> System.AggregateException : One or more errors occurred.
----> Xamarin.UITest.XDB.Exceptions.DeviceAgentException : Unable to contact DeviceAgent on 127.0.0.1
----> System.Net.Http.HttpRequestException : An error occurred while sending the request
----> System.Net.WebException : Error: ConnectFailure (Connection refused)
----> System.Net.Sockets.SocketException : Connection refused
Run Code Online (Sandbox Code Playgroud)
当开始测试时模拟器未运行并且启动模拟器需要很长时间时,似乎会发生这种情况。
我必须确保已将应用程序重新部署到我要测试的模拟器上,并执行所有必要的步骤。
具体发生在我身上的事情是,我将其添加Xamarin.Calabash.Start()到文件中AppDelegate.cs,但我必须确保重新部署到模拟器(在我的情况下,只需在调试模式下启动应用程序),退出,然后启动 UI 测试(s )。
这将确保模拟器上存在正确版本的应用程序。这是在模拟器上测试的唯一方法;在运行测试之前它不会为您部署应用程序。
| 归档时间: |
|
| 查看次数: |
2135 次 |
| 最近记录: |