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

Exception on build: Failed to configure settings for runsettings plugin 'VSTest Run Configuration' #509

Closed markwinspear closed 8 years ago

markwinspear commented 8 years ago

Hi

Steps to reproduce:

  1. Installed Visual Studio 2015 Enterprise
  2. Opened Visual Studio and added the Specflow extension (Tools > Extensions and Updates)
  3. Created new Unit Test project
  4. Added a new Specflow feature file (which contains an example feature)
  5. Added References via NuGet for SpecFlow and SpecFlow.NUnit
  6. Build solution

The error I get is... ------ Discover test started ------ Failed to configure settings for runsettings plugin 'VSTest Run Configuration' as it threw following exception: 'An error occurred while parsing EntityName. Line 1, position 32.' Please contact the plugin author. ========== Discover test finished: 0 found (0:00:00.9800686) ==========

I've not changed the App.config file which contains the following:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" />
  </configSections>
  <specFlow>
    <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config -->
  <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --><unitTestProvider name="NUnit" /></specFlow>
</configuration>

The packages.config file contents:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="NUnit" version="2.6.0.12054" targetFramework="net452" />
  <package id="SpecFlow" version="1.9.0" targetFramework="net452" />
  <package id="SpecFlow.NUnit" version="1.1.1" targetFramework="net452" />
</packages>
samholder commented 8 years ago

Sounds like there is some issue with Specflow.NUnit.

What happens if you remove Specflow.NUnit and just add NUnit itsself and adjust the app.config to use NUnit by adding the <unitTestProvider name=""NUnit" /> to the cofig in the specflow element?

On Tue, Nov 3, 2015 at 12:43 PM, markwinspear notifications@github.com wrote:

Hi

Steps to reproduce:

  1. Installed Visual Studio 2015 Enterprise
  2. Opened Visual Studio and added the Specflow extension (Tools > Extensions and Updates)
  3. Created new Unit Test project
  4. Added a new Specflow feature file (which contains an example feature)
  5. Added References via NuGet for SpecFlow and SpecFlow.NUnit
  6. Build solution

The error I get is... ------ Discover test started ------ Failed to configure settings for runsettings plugin 'VSTest Run Configuration' as it threw following exception: 'An error occurred while parsing EntityName. Line 1, position 32.' Please contact the plugin author. ========== Discover test finished: 0 found (0:00:00.9800686) ==========

— Reply to this email directly or view it on GitHub https://github.com/techtalk/SpecFlow/issues/509.

markwinspear commented 8 years ago

Thanks for the advice Sam.

Following your advice, In NuGet manager, I uninstalled SpecFlow.NUnit (so I now just have SpecFlow, NUnit and NUnit.Runners enabled) According to http://go.specflow.org/doc-config, the only relevant option in the App.config is "NUnit" (there is no Specflow.NUnit) so I've kept that as-is .

I thought this had cracked the issue as I was getting a successful build, however, in the step file, I put a Debug.WriteLine into the Given method created by SpecFlow, and this did not appear to do anything when running the feature.

I chose "rebuild solution" and now get the same error as before

I've put the files onto github (https://github.com/markwinspear/Specflow_Selenium_PO_Example5 ) if that helps?

Thanks again Mark

markwinspear commented 8 years ago

Ok, I've finally found the problem... one of the parent directories had an ampersand in it's title. Somewhere the XML parser must have been reading the directory and that caused the problem! How utterly ridiculous is that message?! Thanks for your help on this

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