Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
2.6k views
by The go-to Tester (222 points)
edited by
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.

1 Answer

0 like 0 dislike
by The go-to Tester (222 points)
Firstly add annotations to your feature files e.g

@myFeature
Feature: ...

@oneOfMyScenarios
Scenario: ...
Given ...

@anotherScenario
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.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...