0

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

每次,当我启动测试时,我都会遇到错误:“SetUp:System.InvalidOperationException:Sequence contains no matching element”。我的测试系列很长一段时间都没有变化,并且之前运行良好......

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

堆栈跟踪:在 System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable1[T] source, System.Func2[T,TResult] 谓词)[0x00065] 在 /private/tmp/source-mono-4.6.0/bockbuild-mono-4.6.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86 /mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs:965 在 Xamarin.UITest.iOS.Instruments.GetAutomationTemplatePath () [0x00031] 在:0 在 Xamarin.UITest.iOS.Instruments.StartInstrumentsInternal(系统.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] 在:0 在 Xamarin.UITest.iOS。 iOS 应用程序启动器。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] 在:0 在 Xamarin.UITest.iOS.iOSAppLauncher.RunAppInEmulator(Xamarin.UITest.Shared.iOS.AppBundle appBundle,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) [0x00099] 在 Xamarin.UITest.iOS.iOSAppLauncher 的 0 中。 LaunchApp (Xamarin.UITest.Configuration.IiOSAppConfiguration appConfiguration, Xamarin.UITest.Shared.Http.HttpClient httpClient, Xamarin.UITest.TestCloud.TestCloudiOSAppConfiguration testCloudAppConfiguration, Xamarin.UITest.Shared.Http.HttpClient testCloudWsClient) [0x000e4] 在:0 在 Xamarin.UITest.iOS.iOSApp..ctor (Xamarin.UITest.Configuration .IiOSAppConfiguration appConfiguration) [0x002db] 在:0 在 Xamarin.UITest.Configuration.iOSAppConfigurator.StartApp (Xamarin.UITest.Configuration.AppDataMode appDataMode) [0x00017] 在: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& ) 在 System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] 参数,System.Globalization.CultureInfo 文化)[0x00038] 在 /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

谢谢!

4

1 回答 1

1

尝试获取最新的 Xcode,然后在正确的 NUnit 版本旁边(2.6.x 和正确的 NUnitTestAdapter 2.1.0)

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

对我来说,2.7 的 2.5 没有工作(同样的错误),没关系。

问候,

于 2017-03-18T15:51:29.533 回答