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.24k stars 754 forks source link

We could not find a data exchange file at the path TechTalk.SpecFlow.SpecFlowException: #1514

Closed jbhano closed 5 years ago

jbhano commented 5 years ago

We could not find a data exchange file at the path TechTalk.SpecFlow.SpecFlowException:

SpecFlow Version:

Used Test Runner

Version number:3.0.255

Visual Studio Version

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"?>
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
    <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342" />
  </configSections>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="TechTalk.SpecFlow" publicKeyToken="0778194805d6db41" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.4.0.0" newVersion="2.4.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <publisherPolicy apply="no" />
        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
        <bindingRedirect oldVersion="4.122.0.0 - 4.65535.65535.65535" newVersion="4.122.18.3" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
<specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
  <stepAssemblies>
      <!-- This attribute is required in order to use StepArgument Transformation as described here; 
    https://github.com/marcusoftnet/SpecFlow.Assist.Dynamic/wiki/Step-argument-transformations  -->
      <stepAssembly assembly="SpecFlow.Assist.Dynamic" />
    </stepAssemblies><!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><!-- use unit test provider SpecRun+NUnit or SpecRun+MsTest for being able to execute the tests with SpecRun and another provider --><unitTestProvider name="SpecRun" /><plugins>
      <add name="SpecRun" />
    </plugins></specFlow>
<system.data>
<DbProviderFactories>
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
<oracle.manageddataaccess.client>
<version number="*">
<dataSources>
<dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
</dataSources>
</version>
</oracle.manageddataaccess.client>
</configuration>

Repro Project

Issue Description

We could not find a data exchange file at the path TechTalk.SpecFlow.SpecFlowException: Unable to find plugin in the plugin search path: SpecRun. Please check http://go.specflow.org/doc-plugins for details.

Please open an issue at https://github.com/techtalk/SpecFlow/issues/ Complete output: TechTalk.SpecFlow.SpecFlowException: Unable to find plugin in the plugin search path: SpecRun. Please check http://go.specflow.org/doc-plugins for details. at TechTalk.SpecFlow.Generator.Plugins.GeneratorPluginLoader.LoadPlugin(PluginDescriptor pluginDescriptor) at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.<>cDisplayClass3.b1(PluginDescriptor pd) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.<ConcatIterator>d__591.MoveNext() at System.Linq.Buffer1..ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at TechTalk.SpecFlow.Generator.GeneratorContainerBuilder.CreateContainer(SpecFlowConfigurationHolder configurationHolder, ProjectSettings projectSettings) at TechTalk.SpecFlow.Generator.TestGeneratorFactory.CreateGenerator(ProjectSettings projectSettings) at TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.Actions.GenerateTestFileAction.GenerateTestFile(GenerateTestFileParameters opts)

Command: c:\users\bhanoj\appdata\local\microsoft\visualstudio\15.0_2f1a2f05\extensions\vffh40qn.t1k\TechTalk.SpecFlow.VisualStudio.CodeBehindGenerator.exe Parameters: GenerateTestFile --featurefile C:\Users\bhanoj\AppData\Local\Temp\6\tmpD618.tmp --outputdirectory C:\Users\bhanoj\AppData\Local\Temp\6 --projectsettingsfile C:\Users\bhanoj\AppData\Local\Temp\6\tmpD617.tmp Working Directory:

Steps to Reproduce

Specflow for Visual Studio Version: 2019.0.9.46639

jbhano commented 5 years ago

And if I go back to Specflow v2.4.0, SpecRun.Runner v1.8.5, SpecRun.SpecFlow v1.8.5 - it's not able to find any test in Test Explorer

SabotageAndi commented 5 years ago

SpecFlow.Tools.MSBuild.Generation is needed for SpecFlow 3. See https://specflow.org/2019/generating-code-behind-files-using-msbuild/ & https://specflow.org/documentation/Generate-Tests-from-MsBuild/

Also remove the plugin section from your app.config. SpecFlow 3 doesn't use it anymore for plugins.

jbhano commented 5 years ago

Added SpecFlow.Tools.MSBuild.Generation nuget package, code snippet in .proj file and removed 'SpecFlowSingleFileGenerator' from all feature files. Also, removed plug-in section, now getting below issue and if I comment unitTestProvider, error goes away but it's not finding tests and error in Tests log is "Unable to fetch symbols for class: Specflow.SpecRun"

Severity Code Description Project File Line Suppression State Error [SpecFlow] System.Configuration.ConfigurationErrorsException: Unrecognized element 'unitTestProvider'. at System.Configuration.ConfigurationElement.DeserializeElement(XmlReader reader, Boolean serializeCollectionKey) at System.Configuration.ConfigurationSection.DeserializeSection(XmlReader reader) at TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler.CreateFromXml(String xmlContent) at TechTalk.SpecFlow.Configuration.ConfigurationLoader.Load(SpecFlowConfiguration specFlowConfiguration, ISpecFlowConfigurationHolder specFlowConfigurationHolder) at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProvider.LoadConfiguration(SpecFlowConfiguration specFlowConfiguration, SpecFlowConfigurationHolder specFlowConfigurationHolder) at TechTalk.SpecFlow.Generator.Configuration.GeneratorConfigurationProviderExtensions.LoadConfiguration(IGeneratorConfigurationProvider configurationProvider, SpecFlowConfigurationHolder configurationHolder) at TechTalk.SpecFlow.Generator.Project.ProjectReader.ReadSpecFlowProject(String projectFilePath, String rootNamespace)

SabotageAndi commented 5 years ago

Ok, you have also the unitTestProvider set in the app.config You need to remove this also.

See https://specflow.org/2019/updating-to-specflow-3/ - App.config Deprecated

jbhano commented 5 years ago

OK, created specflow.json.

`{ "bindingCulture": { "language": "en-us" }, "language": { "feature": "en-us" },

"unitTestProvider": { "name" : "SpecRun" }, "plugins": []

} `

It's still not able to find any test in Tets Explorer - getting following error in Tests pane

[4/8/2019 5:56:54 PM Informational] NUnit Adapter 3.13.0.0: Test discovery starting [4/8/2019 5:56:54 PM Informational] NUnit Adapter 3.13.0.0: Test discovery complete [4/8/2019 5:56:54 PM Error] Unable to fetch symbols for class: xxxx.Specflow.SpecRun [4/8/2019 5:56:54 PM Warning] Unable to fetch source Information for test method: xxx.Specflow::SpecRun

Stephen-Mc commented 5 years ago

You need to completely remove the unitTestProvider from your configuration, as Andi wrote above. The unit test provider is now configured by installing the appropriate NuGet package, i.e. one of the following:

So remove this section:

"unitTestProvider": {
"name" : "SpecRun"
},
jbhano commented 5 years ago

Here's my specflow.json

{ "bindingCulture": { "language": "en-us" }, "language": { "feature": "en-us" },

"plugins": []

}

And I have SpecRun.Runner, still same issue - Test explorer not able to find tests

Nuget Packages

SabotageAndi commented 5 years ago

@jbhano We released yesterday new packages for SpecFlow and SpecFlow+Runner. My current assumption is, that you have a problem with the manual editing of the csproj file. With the latest release, it isn't anymore needed to manually change your csproj.

SabotageAndi commented 5 years ago

Closed because of inactivity. Please reopen or leave a comment if you still have this issue.

lock[bot] commented 4 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.