I want to run single scenario from feature file with multiple scenarios using the Eclipse IDE. I'm using JUnit as my testing framework. I was able to run in selenium spec-flow but I am using eclipse Mavan I am not sure how to do. But definitely, I was executing whatever the spec-flow feature I want to execute I was able to by highlighting and right click.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

1 Answer

by (202 points)
0 votes
Firstly add annotations to your feature files e.g

Feature: ...

Scenario: ...
Given ...

Scenario: ...
Given ...

Then add the following argument to the VM args in Eclipse Run Configurations

Click Run in the top menu
Click Run configurations
Click on the JUnit test which runs the cucumber features
Click the arguments tab
Enter the following into the VM arguments box:
-Dcucumber.options="--tags @oneOfMyScenarios"
Hit run

The individual scenario that has been tagged with the specified annotation will run by itself.