Search code examples
c#visual-studioseleniumspecflowxunit

Specflow test not discovered on test explorer c#


I have researched a lot before posting the question but I could not find a solution to fix my issue.

I am trying to use selenium to do automation testing, but the issue is that my test explorer is not picking up the specflow tests for some reason.

Here is what I am using:

  • c# .net core project
  • Specflow
  • Xunit
  • Selenium driver
  • Selenium Chrome Driver

NuGet Packages I have installed:

  • Selenium.Support
  • Selenium.WebDriver
  • Selenium.WebDriver.ChromeDriver
  • Specflow
  • Specflow.NetCore
  • Specflow.xUnit
  • SpecRun.Runner
  • xunit
  • xunit.core
  • xunit.runner.visualstudio

I also have the Specflow for Visual Studio 2017 installed.

I have installed and Uninstalled loads of NuGet packages to try and fix this issue. Anyone able to help me please?


Solution

  • After a lot of trying, I finally fixed. After deleting one of the the runners, SpecRun, I added the Specflow.Tools.MSbuild.Generation NuGet Package and it fixed the problem.

    Hope it is useful for someone with the same issue!