10
votes

I am using selenium, Specflow and nUnit to run automated tests with visual studio. The code was working with visual studio 2010. After I installed visual studio 2012, selenium and Specflow again (I think I did it right), it stopped working. First, the steps didn't recognize their definitions and I think I fix it writing [Binding] in all the c# files that contains their definitions. Now when I try to build the project it shows an error that I can't solve to all feature files.

It shows 50 errors (the same number of Specflow feature files I have), they are all the same, and it says this:

Error: Generation error: SpecFlow configuration error -> The element <unitTestProvider> may only appear once in this section.

I don't know how to fix this. I hope somebody can help me, I am really worry because of this.

2
What version of SpecFlow, Selenium and NUnit are you running? - Arran
Nunit is 2.6.2, specflow 1.9.0, selenium webdriver 2.29.1 - JoleG
Does it still work in VS2010? - AlSki
No, it doesn't work anymore in VS2010 because VS2010 is not compatible with VS2012. - JoleG
Actually vs2010 sp1 can round trip with vs2012. blogs.msdn.com/b/zainnab/archive/2012/06/05/… So what error are you seeing? - AlSki

2 Answers

19
votes

Keep only one attribute as unitTestProvider name="SpecRun" or unitTestProvider name="NUnit" in app.config

This error is caused by two 'unitTestProviders' in app.config.

0
votes

After I install-Package SpecRun.SpecFlow -Version 1.2.0,

I've got 2 entries unitTestProvider name="SpecRun" and unitTestProvider name="NUnit" in app.config, that coused the error.

It should be manually changed to combined one

 <unitTestProvider name="SpecRun+NUnit" />