xamarin - 尝试在本地运行 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://docs.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 测试云代理包并#if ENABLE_TEST_CLOUD
从AppDelegate.cs
. 但是,它仍在发生。如何在本地运行 iOS 测试?谢谢!
解决方案
如果您想使用 xamarin 自动化 uitest,则必须在您的 xamarin ios 项目中添加测试云代理 nuget,以启用链接到 Calabash 并在您的手机中安装设备代理运行程序。有关更多详细信息,请访问 Microsoft 网站。 https://docs.microsoft.com/en-us/appcenter/test-cloud/uitest/preparing-for-upload-ios
无论您是在应用程序输入上上传测试还是在本地运行它。您必须在 xamarin ios 中添加测试云代理 nuget。如果您使用的是原生 iOS,Calabash 链接需要运行 xamarin uitest。
推荐阅读
- winapi - 指向 IFileOperation::DeleteItems 方法的 IShellItemArray 的 IUnknown 的指针
- python - 减少 XML 文件编程的代码长度 (Python)
- python-3.x - 如何从每个第一个非 NaN 值中过滤数据框,直到下一个并从相应列中求和值?
- angular - 具有动态 ID 的默认路由
- java - 使用 json-simple-1.1.1.jar 运行 Java 文件的终端命令
- apache-spark - Spark-submit 在 HTTP 代理后面时无法解析 --package 依赖项
- javascript - 机器人正在删除所有消息
- if-statement - 在 If 语句期间调用另一个子
- spring - 使用 LettuceConnectionFactory 向 Spring Data Redis 添加压缩
- swift - 使用协议调用 viewDidDisappear 中的函数时,ScrollView IBOutlet nil