UITest失败了:" SetUp:System.InvalidOperationException"

时间:2017-01-04 18:29:06

标签: c# ios xamarin.ios nunit uitest

自上次使用Xcode 8.2在稳定通道上更新xamarin以来,我无法再使用UITest进行我的xamarin项目。

每次,当我启动测试时,我都会遇到错误:" SetUp:System.InvalidOperationException:Sequence不包含匹配的元素"。我的测试系列在很长一段时间内没有变化,而且在...之前运作良好。

所以我现在不知道如何纠正这个问题......

堆栈跟踪:   在System.Linq.Enumerable.First [TSource](System.Collections.Generic.IEnumerable 1[T] source, System.Func 2 [T,TResult]谓词)[0x00065] /private/tmp/source-mono-4.6.0/bockbuild - 单 - 4.6.0分支/简档/单MAC-xamarin /建立根/单声道86 / MCS /类/ referencesource / System.Core程序/系统/ LINQ的/ Enumerable.cs:965   在Xamarin.UITest.iOS.Instruments.GetAutomationTemplatePath()[0x00031]中:0   在Xamarin.UITest.iOS.Instruments.StartInstrumentsInternal(System.String targetApplication,Xamarin.UITest.iOS.iOSRunType runType,System.String deviceId,System.String runLoopPath,Xamarin.UITest.Configuration.AppDataMode appDataMode,System.Predicate`1 [ T] dropLine)[0x00006] in:0   在Xamarin.UITest.iOS.Instruments.StartInstruments(System.String targetApplication,Xamarin.UITest.iOS.iOSRunType runType,System.String deviceId,Xamarin.UITest.Configuration.AppDataMode appDataMode)[0x00012] in:0   在Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulatorInternal(System.String应用程序,Xamarin.UITest.iOS.Instruments工具,Xamarin.UITest.Shared.Http.HttpClient httpClient,System.Uri deviceUri,Xamarin.UITest.Shared.Artifacts.ArtifactFolder artifactFolder,Xamarin.UITest.Configuration.AppDataMode appDataMode,System.String deviceIdentifier)[0x00095] in:0   在Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulator(Xamarin.UITest.Shared.iOS.AppBundle appBundle,Xamarin.UITest.iOS.Instruments instruments,Xamarin.UITest.Shared.Http.HttpClient httpClient,System.Uri deviceUri,Xamarin.UITest .Shared.Artifacts.ArtifactFolder artifactFolder,Xamarin.UITest.Configuration.AppDataMode appDataMode,System.String deviceIdentifier)[0x00099] in:0   在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 )[0x000e4] in:0   在Xamarin.UITest.iOS.iOSApp..ctor(Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration)[0x002db] in:0   在Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp(Xamarin.UITest.Configuration.AppDataMode appDataMode)[0x00017] in:0   在Ac.Test.TestV35.BeforeEachTest()[0x00012] /Users/ShaprAdmin/Documents/ac/Ac.Test/TestV35.cs:17   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)[0x00038] in / private / tmp /source-mono-4.6.0/bockbuild-mono-4.6.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305

谢谢!

1 个答案:

答案 0 :(得分:1)

尝试抓住最新的Xcode和 然后在适当的NUnit版本(2.6.x和适当的NUnitTestAdapter 2.1.0)旁边

尝试将Xamarin.UITest软件包升级/降级到2.5版。

对于我而言,对于2.7而言,它没有工作(有相同的错误),因为它没问题。

问候,