For true parallel execution of Selenium tests in NUnit, does the setup of the webdriver object need to be within the test method itself? Or is there a better way?
Previously, for parallel execution at the fixture level, I was able to create single objects (per fixture) within the [Setup] and backend methods. However, when moving towards test & fixture parallelism, I began encountering problems where tests within one fixture were all trying to access the same driver object.
I did manage to get a solution which involved [ThreadStatic] against the static driver object but this resulted in every test run keeping its driver object open till all had finished, which just seemed wrong.
I’m keen to push driver setup out of the tests and back toward [Setup] and backend methods, to reduce code duplication and keep the test method focussed on the test. I’ve researched the area but only seemed to come across fixture-level parallel execution but am keen for the full-on test & fixture-level parallel execution so I welcome any suggestions!