Unrecognized element unitTestProvider Unrecognized element unitTestProvider selenium selenium

Unrecognized element unitTestProvider


That config file will not work with version 3.0 and up of SpecFlow. You can read the documentation on how to update to 3.0 here. It says:

Changes to How Unit Test Providers are Configured

In previous versions of SpecFlow, the unit test provider used to execute tests was configured in your app.config file. As of SpecFlow 3, we strongly recommend configuring your unit test provider by installing one of the available packages (see below).

And also:

specflow.json

Moving forward, we recommend using specflow.json to configure SpecFlow, rather than app.config. .NET Core projects require specflow.json (app.config is not supported). While using specflow.json is optional for Full Framework projects, we recommend migrating to the new format. For more details, see Configuration in the documentation.

So you can remove SpecFlow from app.config and create a file called specflow.json instead. You can put the following into it:

{    "language": {        "feature": "en-US"    }}

You can change language to something else if you want to.

You have to add a test runner to your project, if you don't have that already. In your case, it's NUnit, so add SpecFlow.NUnit with NuGet. You generally need the packages that are listed in the example project for NUnit.


so I solved same issue by taking following steps :

  1. Go to manage nugget package for solution and looked up for spec flow under installed where it was showing version 3.1.97 ( updated by self) uninstall and install version 3.1.76 for whole project including test framework( specflow) .

  2. For Specflow.nunit uninstall and install version 3.1.76 but not for test framework(uncheck the box next to it) but other projects should have reverted back.

  3. Did same for Specflow.Tools.Msbuild.geneartion as step 2 and restart machine.