mardi 15 octobre 2019

Where initialize and destroy webdriver to avoid problems with parallel execution of tests?

I've seen several approaches to instantiate web driver in Specflow examples.

  1. 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/

  1. 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