When trying to configure SpecFlow to generate a test results report file for publishing to Behave Pro you might receive this error:

The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.System.Exception: Unit test Provider already set.at TechTalk.SpecFlow.UnitTestProvider.UnitTestProviderConfiguration.UseUnitTestProvider(String unitTestProviderName)

This error indicates that your SpecFlow solution is configured to use xUnit or Nunit to execute your SpecFlow tests. These test runners can not generate custom reports that can be consumed by BDD tools.

Our solution for generating the JSON report from SpecFlow uses SpecFlow+, a dedicated test runner for SpecFlow that replaces the need for xUnit and Nunit. SpecFlow+ has a number of other advantages and we recommend teams consider switching to it.

Without using SpecFlow+ isn't possible to publish test results to Behave Pro or other BDD tools

Did this answer your question?