6

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

Sam Holder
  • 32,535
  • 13
  • 101
  • 181
Sonja
  • 575
  • 1
  • 6
  • 20
  • 1
    Have 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 Answers5

4

For me, the test displayed after the Specflow MSTest was added from NuGet. enter image description here

Marcello B.
  • 4,177
  • 11
  • 45
  • 65
Amishra
  • 41
  • 2
1

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:

  1. Close all Visual Studio instances
  2. Navigate to your %TEMP%\VisualStudioTestExplorerExtensions\ folder and delete any sub-folders related to SpecFlow/SpecRun.
  3. Reopen your solution and ensure that it builds.

https://github.com/techtalk/SpecFlow/wiki/Troubleshooting-Visual-Studio-Integration

Hope this helps

DerrickF
  • 682
  • 5
  • 9
  • 1
    No, 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
0

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

Sonja
  • 575
  • 1
  • 6
  • 20
0

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>
0

You just need to add these configurations in your .csproj file.

  1. Remove Microsoft.NET.Test.Sdk and replace it with Microsoft.TestPlatform.TestHost

  2. Add these two in PropertyGroup tag and rebuild the project

     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <GenerateRuntimeConfigDevFile>true</GenerateRuntimeConfigDevFile>
    
Kaveh Naseri
  • 1,102
  • 2
  • 15
  • 24