UI测试,无法运行iOS ui测试-无法确定X

时间:2019-04-08 06:23:53

标签: xamarin.ios xamarin.uitest

当我想为iOS运行UI测试时,会收到以下消息:

SetUp : System.Exception : Unable to determine simulator version for X

堆栈跟踪:

  at Xamarin.UITest.iOS.Instruments.GetMajorVersionForSimulator (System.String deviceIdentifier) [0x0008c] in <2a16c16730a54859bda72c6bc1c728f7>:0 
  at Xamarin.UITest.iOS.iOSAppLauncher.LaunchAppLocal (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, System.Boolean clearAppData) [0x0011a] in <2a16c16730a54859bda72c6bc1c728f7>:0 
  at Xamarin.UITest.iOS.iOSAppLauncher.LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient, Xamarin.UITest.Shared.Http.HttpClient xtcServicesClient, System.Boolean testCloudUseDeviceAgent) [0x00068] in <2a16c16730a54859bda72c6bc1c728f7>:0 
  at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Execution.IExecutor executor) [0x002af] in <2a16c16730a54859bda72c6bc1c728f7>:0 
  at Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration) [0x00000] in <2a16c16730a54859bda72c6bc1c728f7>:0 
  at Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] in <2a16c16730a54859bda72c6bc1c728f7>:0 
  at UniversalApp.UITests.AppInitializer.StartApp (Xamarin.UITest.Platform platform) [0x0002d] in /Users/testing/backend/src/UniversalApp.UITests/AppInitializer.cs:33 
  at UniversalApp.UITests.DummyTests.BeforeEachTest () [0x00001] in /Users/testing/backend/src/UniversalApp.UITests/DummyTests.cs:26 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0003b] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 

当我在Android上运行相同测试时,所有功能都像魅力一样。这是在我将xcode 10.2降级到10.1时发生的,因此可能是某些地方损坏了。但是,奇怪的是我可以毫无问题地调试我的iOS应用程序。

预先感谢

2 个答案:

答案 0 :(得分:2)

此问题的原因是Xcode 10.2对Xamarin.UITest能够与本地iOS模拟器进行连接的方式进行了更改;恢复兼容性之前,必须先更新Xamarin.UITest。根据我在重现问题时的观察,即使您降级到Xcode 10.1,iOS模拟器似乎仍然保留了Xcode 10.2应用的某些设置,因此继续阻止测试。

尚不支持Xcode 10.2的Xamarin.UITest的当前版本,尽管我怀疑它将在下一个版本中发布。 (在撰写本文时,最新版本是2.2.7.28-dev)

以前在其他Xcode更新中也发生过这种情况:

答案 1 :(得分:0)

将Xamarin.UITest更新为3.0.7,为我解决了该问题

enter image description here