SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.25k stars 754 forks source link

UI test fails with error: Exception has been thrown by the target of an invocation. #1726

Closed jpc1963 closed 4 years ago

jpc1963 commented 5 years ago

UI test fails with error: Exception has been thrown by the target of an invocation.

SpecFlow Version:

Used Test Runner

Version number: 3.1

Project Format of the SpecFlow project

.feature.cs files are generated using

Visual Studio Version

Enable SpecFlowSingleFileGenerator Custom Tool option in Visual Studio extension settings

Are the latest Visual Studio updates installed?

.NET Framework:

Test Execution Method:

<SpecFlow> Section in app.config or content of specflow.json

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="BoDi" version="1.4.1" targetFramework="net452" />
  <package id="Gherkin" version="6.0.0" targetFramework="net452" />
  <package id="NUnit" version="3.12.0" targetFramework="net452" />
  <package id="NUnit.Console" version="3.10.0" targetFramework="net452" />
  <package id="NUnit.ConsoleRunner" version="3.10.0" targetFramework="net452" />
  <package id="NUnit.Extension.NUnitProjectLoader" version="3.6.0" targetFramework="net452" />
  <package id="NUnit.Extension.NUnitV2Driver" version="3.7.0" targetFramework="net452" />
  <package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net452" />
  <package id="NUnit.Extension.TeamCityEventListener" version="1.0.6" targetFramework="net452" />
  <package id="NUnit.Extension.VSProjectLoader" version="3.8.0" targetFramework="net452" />
  <package id="SpecFlow" version="3.0.225" targetFramework="net452" />
  <package id="SpecFlow.NUnit" version="3.0.225" targetFramework="net452" />
  <package id="System.Reflection.Emit" version="4.3.0" targetFramework="net452" />
  <package id="System.Reflection.Emit.Lightweight" version="4.3.0" targetFramework="net452" />
  <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net452" />
  <package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net452" />
  <package id="System.ValueTuple" version="4.5.0" targetFramework="net452" />
  <package id="Utf8Json" version="1.3.7" targetFramework="net452" />
  <package id="Xamarin.UITest" version="3.0.3" targetFramework="net452" />
</packages>

Repro Project

Issue Description

I develop UI tests for apps on iOS & Android devices & simulators. I write UI Tests using VS 2019 on a MAC and recently tried to update my nuget packages to the latest version: NUnit = 3.12 Xamarin.UITest = 3.03 Specflow = 3.0.225

On Visual studio for the MAC I have always used Straight8s Specflow Integration to edit my feature files. The latest version generates code for specflow 3 - hence the upgrading my nuget packages.

When I run a test I get the following error (which occurs when trying to start the app on a simulator): 1 - LaunchTestAsync: deviceId: bla.bla 1 - Launching simulator if not already running Test server version: 0.21.7 Error: Exception has been thrown by the target of an invocation.

See attachments for further error info. NOTE: I removed all Specflow elements from the project and turned it into a simple Nunit test. This runs OK on my simulators / emulators.

Xamarin.Test.Results.txt Simulator.Log.txt

Any ideas?

Steps to Reproduce

SabotageAndi commented 5 years ago

No ideas on my side. We don't maintain the SpecFlow VS Extension for VS for Mac/MonoDevelop/XamarinStudio and in the callstacks I don't see anything related to SpecFlow.

What I know is, that Xamarin UITest has some ugly hacks for SpecFlow support that is version dependent. Perhaps they didn't update it yet for SpecFlow 3.

jpc1963 commented 5 years ago

OK thanks I'll follow it up with Xamarin.

SabotageAndi commented 4 years ago

Closed because of inactivity

github-actions[bot] commented 3 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.