I have installed Visual studio 2015 on multiple PC and application that is using SpecFlow. The application is working normally on 1 pc because everything there was installed long time ago. However on the other PCs tests are not being displayed in the test explorer, and I need them in the test explorer. Please help
-
1Have you tried [this](http://stackoverflow.com/questions/30573482/built-tests-are-not-added-to-the-visual-studio-test-explorer-window) or installed the NUnit test adapater as suggested [here](http://www.marcusoft.net/2012/09/getting-visual-studio-2012-test.html), both links found from simply googling the quetion title... – Sam Holder May 11 '16 at 11:15
-
you also should specify which testing framework you are generating your tests in, NUnit, MSTest, XUnit etc etc – Sam Holder May 11 '16 at 11:16
-
The tests are in NUnit – Sonja May 11 '16 at 12:14
-
Yes Sam I have tried suggested no results – Sonja May 11 '16 at 12:15
5 Answers
For me, the test displayed after the Specflow MSTest
was added from NuGet.

- 4,177
- 11
- 45
- 65

- 41
- 2
Tests are not displayed in the Test Explorer window when using SpecFlow+ Runner
I run into this all the time. There is a great section on the GitHub repo page for specflow that I keep bookmarked for when stuff like this comes up. Usually this one (deleting the cache file) fixes issues for me.
The Visual Studio Test Adapter cache may also get corrupted, causing tests to not be displayed. If this happens, try clearing your cache as follows:
- Close all Visual Studio instances
- Navigate to your %TEMP%\VisualStudioTestExplorerExtensions\ folder and delete any sub-folders related to SpecFlow/SpecRun.
- Reopen your solution and ensure that it builds.
https://github.com/techtalk/SpecFlow/wiki/Troubleshooting-Visual-Studio-Integration
Hope this helps

- 682
- 5
- 9
-
1No, it doesn't help. I've tried deleting VisualStudioTestExplorerExtensons and also reinstalling Specflow+runner, nothing solves the problem – Sonja May 12 '16 at 07:58
-
closing visual studio instance, opening visual studio again and rebuilding the project solved the issue for me – Suban Dhyako May 26 '21 at 13:16
Thanks guys but I managed to fix my problem. The tests are displayed as soon as NUnit Test Adapter is installed:
Go to Tools->Extensions and updates ->Online->Visual Studio Gallery->Tools->Testing and select NUnit Test Adapter

- 575
- 1
- 6
- 20
if you have a file .srpofile in your solution, then adjust your gherkin steps according to file tags.# \in my case .srprofile is like below
<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
<Settings projectName="project.test" projectId="{9A19103F-16F7-4668-BE54-9A1E7A4F7556}" outputFolder=".\Results" />
<Execution stopAfterFailures="0" retryFor="None" testSchedulingMode="Sequential" />
<Filter>@automated</Filter>
<TestAssemblyPaths>
<TestAssemblyPath>project.test.dll</TestAssemblyPath>
</TestAssemblyPaths>
</TestProfile>

- 11
- 1
- 2
You just need to add these configurations in your .csproj
file.
Remove
Microsoft.NET.Test.Sdk
and replace it withMicrosoft.TestPlatform.TestHost
Add these two in
PropertyGroup
tag and rebuild the project<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies> <GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>

- 1,102
- 2
- 15
- 24