Hi,
I'm having a problem with Test Explorer Window not discovering tests when SpecFlow is configured to run with SpecRun.
I have a simple project created according to the setup instructions and it works perfectly in VS2013 Premuim on Windows 8.1. with an App.Config file like this.
<specFlow>
<unitTestProvider name="SpecRun" />
<plugins>
<add name="SpecRun" />
</plugins>
</specFlow>
However, when i copy the same project to a machine with Windows 7 the test discovery silently fails, and no tests are found in the Test Explorer Window.
I have tried this on several combinations of Visual Studio and OS on different computers.
Specflow1.9.0, SpecRun 1.2.0 and 1.3.0-alpha1 (same result for both versions), .NET4.5
Windows 8.1 x64, VS2012 Premium, Update 4 : Works
Windows 8.1 x64, VS2013 Premium, Update 2 : Works
Windows 7, x64, VS2010 Pro, SP1 (.Net4.0) : Fails.
Windows 7, x86, VS2012 Premium : Fails.
Windows 7, x64, VS2013 Pro, Update2 : Fails.
In all cases the "Run Specflow Scenarios" command works just fine and runs the test with SpecRun so SpecRun itself works ok.
If I set unitTestProvider = "SpecRun+MsTest" the MSTest versions of the test scenarios are discovered in all cases but SpecRun is not used when running the tests from the Test Explorer.
It seems to be related to Windows 7 but I cannot find what the problem is.
Has anyone experienced this and have a clue to how to solve or how to debug this problem?
I suppose this has been resolved with the nuget package of xunit runner/ nunit runner runners for specflow ?
I have this same issue with Windows Server 2012. I think the VS plugin is at issue since I also see that it isn't offering to rebuild the feature files when I change my test provider in app.config. It does this on the machine that's working but not on the one that isn't.
Visual Studio caches the test runner adapters, and in the most of the cases a corrupted cache is the reason for this. To clean the cache, you have to do the following:
1.聽聽聽聽聽聽 Close all Visual Studio instances
2.聽聽聽聽聽聽 Go to %TEMP%\VisualStudioTestExplorerExtensions\
3.聽聽聽聽聽聽 Delete specrun related folders
4.聽聽聽聽聽聽 Try again
I close this, please reopen if you see any further issues.
@gasparnagy: I had a similar issue wherein the Visual Studio 2013 won't recognise any tests created by specFlow in the Test Explorer. I tried restarting the application, readding the NuGet Packages to my project and upon trying your advice, I wasn't able to find the path %TEMP%\VisualStudioTestExplorerExtensions\ in the windows explorer.
Do you have any other ideas to get this done?
Under Visual studio project properties > Application > Output type should be Class Library . If you have unitTestProvider = "SpecRun" if enought no need to add MsTest reference in library.
so, Gasparnagy, we found that you need to delete the folders, and the 'specflow-stepmap~' CACHE files, that exist in that folder ...
Hmm.. mine was a mistake in that I converted a method into a [TestMethod] not checking for the following constraints reported in the output window:
Test method marked with the [TestMethod] attribute must be non-static, public, return-type as void and should not take any parameter. Example: public void Test.Class1.Test(). Additionally, return-type must be Task if you are running async unit tests.
Methinks this should be an outright compile error, rather than successfully compiling, but not showing up p on the Test Explorer.
I just removed all installed packages and added them again from NuGet gallery. Tests are loaded then in explorer.
I had to remove and re-add the SpecFlow.nUnit package, update it (to 2.1.0) then add 'NUnit3TestAdapter' - it seems I needed this since nUnit got updated to v3. Also 'SpecFlow.nUnit.Runners' does NOT work (for me at least) - it adds an extension class that won't compile.
Install NUnit and NUnit3TestAdapter continue build project, now Test explorer will display all tests.

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.
Most helpful comment
Install NUnit and NUnit3TestAdapter continue build project, now Test explorer will display all tests.