Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

NUnit 3 / UITest failing with error: Exception has been thrown by the target of an invocation

$
0
0

Hi I have a Xamarin UI test project with tests apps on iOS and Android simulators. I have recently updated my nuget packages to the latest version.
I run my tests on an Android emulator or iOS simulator. And I start the app as follows:

IApp myApp =  ConfigureApp
            .iOS
            .InstalledApp(pathToApp)
            .DeviceIdentifier(123456-123456)
            .PreferIdeSettings()
            .EnableLocalScreenshots()
            .WaitTimes(new WaitTimes())
            .Debug()
            .StartApp(ClearAppData);

The app starts ok on the simulators but immediately gives the error: Exception has been thrown by the target of an invocation.
It seems similar to this (but the versions are different) : https://forums.xamarin.com/discussion/153230/how-to-fix-system-argumentnullexception-value-cannot-be-null-parameter-name-key

I use the following environment:
- NUnit 3.11
- NUnit console runner 3.10
- Specflow 3.0.213
- Xamarin UITest 3.0.0 (compatible with NUnit 3)
- xCode 10.2.1
- Google APIs 28

In the application output I get the following messages after the above error

Thread finished: #3
1 - Exception
Exception: System.Threading.ThreadAbortException: Thread was being aborted.
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait(object,int)
at System.Threading.Monitor.ObjWait (System.Boolean exitContext, System.Int32 millisecondsTimeout, System.Object obj) [0x0002f] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/mcs/class/corlib/System.Threading/Monitor.cs:83
at System.Threading.Monitor.Wait (System.Object obj, System.Int32 millisecondsTimeout, System.Boolean exitContext) [0x0000e] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:210
at System.Threading.Monitor.Wait (System.Object obj, System.Int32 millisecondsTimeout) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:220
at System.Threading.ManualResetEventSlim.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00141] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/mcs/class/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs:669
at System.Threading.Tasks.Task.WaitAllBlockingCore (System.Collections.Generic.LowLevelListWithIList 1[T] tasks, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00038] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:4703
at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x000e6] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:4619
at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks, System.Int32 millisecondsTimeout) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:4482
at System.Threading.Tasks.Task.WaitAll (System.Threading.Tasks.Task[] tasks) [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2018-08/external/bockbuild/builds/mono-x64/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:4405
at Xamarin.UITest.XDB.Services.Processes.ProcessService.Run (System.String command, System.String arguments) [0x0004f] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.XDB.Services.OSX.XcodeService.TestWithoutBuilding (System.String deviceId, System.String xctestrunPath, System.String derivedDataPath) [0x0002b] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.XDB.Services.OSX.iOSDeviceManagerService.StartTest (System.String deviceId) [0x00022] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.XDB.Services.iOSDeviceAgentService+<>c__DisplayClass17_0.b__2 () [0x00000] in <18ae7883e2424c558186d1d9edf9f14b>:0
at Xamarin.UITest.XDB.Services.iOSDeviceAgentService.WithErrorHandling (System.Int32 eventId, System.Func 1[TResult] action, System.String errorMessage, System.Int32[] successCodes) [0x0000e] in <18ae7883e2424c558186d1d9edf9f14b>:0

Does anyone have any ideas??
Thanks


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>