尝试在本地运行 Xamarin UITest 时,"无法联系应用中运行的测试后端"



我正在学习如何为我的公司自动化Xamarin应用程序。 我一开始只是从Microsoft克隆 TailWind Traders 应用程序,以确保我的系统配置正确,但我遇到了一个问题。修改AppManager.cs以使用 .app 文件并尝试运行单个 iOS 测试后,我在模拟器中看到应用程序加载,我收到 Mac 警报,指出"您是否希望应用程序'DeviceAgent-Runner.app'接受传入的网络传输",然后测试失败并显示以下消息:

System.Exception : Unable to contact test backend running in app. Check that your app is running and that it is properly configured:
For Xamain.iOS applications,  https://learn.microsoft.com/en-us/appcenter/test-cloud/preparing-for-upload/xamarin-ios-uitest
For native iOS applications,  https://github.com/calabash/calabash-ios/wiki/Tutorial%3A-How-to-add-Calabash-to-Xcode

转到该网站,我看到它正在帮助用户配置正在运行的测试 AppCenter,但我不想这样做。我只想在我的机器上本地运行测试。 在尝试解决此问题时,我卸载了 Xamarin 测试云代理包并从AppDelegate.cs中删除了#if ENABLE_TEST_CLOUD块。 但是,它仍在发生。如何在本地运行 iOS 测试? 谢谢!

如果要使用 xamarin自动化 uitest,则必须在 xamarin ios 项目中添加测试云代理 nuget,以便链接到 Calabash 并在手机中安装设备代理运行程序。有关更多详细信息,请访问Microsoft网站。 https://learn.microsoft.com/en-us/appcenter/test-cloud/uitest/preparing-for-upload-ios

无论是在应用上上传测试,请输入还是在本地运行测试。您必须在 xamarin ios 中添加测试云代理 nuget。如果您使用的是本机iOS,Calabash链接需要运行xamarin uitest。

最新更新