0

I want to implement TestRunner into my project to execute the test feature wise or in the given order but couldn't find any proper document or video how to integrate TestRunner in the project, as I am new in specflow and automation so I am not getting the idea. If anyone has implemented TestRunner then, please suggest me how can I implement.

I am trying to run my Feature file using right click on Feature file and click on Run as SpecFlow Scenarios but test execution doesn't start do I need to add an extra library to execute feature file using Run as SpecFlow Scenarios.

Ashish Verma
  • 19
  • 1
  • 9

3 Answers3

2

I don't know why but 'Run SpecFlow Scenarios" button from context menu doesn't work indeed.

To be able to run your tests you need to install an adapter for your test framework.

If you use MStest then install MSTest.TestAdapter

If you use Nunit then install NUnit3TestAdapter

When you do you'll see the tests in your tests explorer: enter image description here

Denis Koreyba
  • 3,144
  • 1
  • 31
  • 49
  • Thanks, Denis for your reply, I am using the same approach now but I want to run all the test scenario for a particular feature file. Now I have to manually select all the scenario to execute. I don't know why Run Specflow Scenarios is not working in my system. Can you please suggest any alternative solution – Ashish Verma Nov 06 '18 at 10:10
  • @AshishVerma actually visual studio tests explorer groups your tests by features. So you can select needed feature and run its scenarios. What problems do you have with it? Personally I use Resharper for tests run. – Denis Koreyba Nov 06 '18 at 11:45
0

Denis Koreyba provided what you are probably looking for.

Another way could be to run the test from the command line.

These two topics on StackOverflow provide information on how to do this, depending on your test framework:

Console Application to launch Specflow features by code not using ncode runner

How do you run SpecFlow scenarios from the command line using MSTest?

Jeroen Lamberts
  • 191
  • 1
  • 8
0

You can change the test explorer view to "Group by namespace" then you will see all the features and you can run the scenarios inside the feature. Refer below image

enter image description here

Sandesh A D
  • 162
  • 2
  • 12