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

0 like 0 dislike
305 views
by
retagged by
I have created one feature file which has 4 scenarios. Do I need to create 4 step definitions or only 1?

If 1 then is it ok to have multiple @Given, @When and @Then in one step definition?

1 Answer

0 like 0 dislike
by The go-to Tester (142 points)

It depends on the complexity of the elements in page. If the scenario involves interaction with elements in multiple pages, or a single page having too many elements then it’s better to split into multiple step definition classes. This will help out in maintaining your tests well versed

Currently working on a PoC for BDD with Specflow + NUnit so my take always are

1. Multiple scenario with single Feature file

2. Common Step definition file for generic functions

3. Generic file for handling utils functions


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

...