0

I have a test solution running specflow and selenium, until now I managed to run the tests in parallel by sharing a single Webdriver for all test scenarios, but now I'm getting some problems with that setup. How do you manage to run your selenium tests in parallel with Nunit without sharing a single webdriver?

Dayan54
  • 31
  • 3

1 Answers1

0

Best thing is to have a new WebDriver for every scenario.
We have a sample how you can to it here: https://github.com/techtalk/SpecFlow.Plus.Examples/tree/master/SeleniumWebTest

What it does is that it encapsulates the WebDriver in it's own class (https://github.com/techtalk/SpecFlow.Plus.Examples/blob/master/SeleniumWebTest/TestApplication.UiTests/Drivers/WebDriver.cs).

Because the instance is saved in the DI container of SpecFlow, you will get for every scenario a new instance.

Andreas Willich
  • 5,665
  • 3
  • 15
  • 22