I've seen several approaches to instantiate web driver in Specflow examples.
- Creating it in the steps definition class and disposing it in
Dispose
method for the class
Why is it horrible? Cause 1 scenario doesn't equal 1 steps definition class as some steps are just shared between features and there will be more than 1 web driver instantiated. Example: https://www.softwaretestinghelp.com/specflow-and-selenium/
- Creating it in hooks
[BeforeScenario]
and destroying int in[AfterScenario]
It won't probably work with parallel execution.
Question: How to manage WebDriver
instances in Specflow UI tests solution with NUnit?
Aucun commentaire:
Enregistrer un commentaire