Parallel and Sequential Test execution with XUnit and Selenium
In this very short article we will discuss the Parallel and Sequential test execution capabilities of XUnit to run Selenium tests
Here are other articles on XUnit which you may be interested in
XUnit Parallel Nature
XUnit by default run all test tests in parallel which are sitting in separate class files. This makes it easy to run our test in parallel without us doing any special configuration.
Also, in Visual studio and in many popular IDE’s you can select all the tests in Test Runner/Explorer and run them by selecting “Parallel” option
XUnit Sequential
In Order to run XUnit test in sequential fashion, we need to decorate our test class with attribute called as [collection]
e.q.
[Collection("Sequence")]
public class SecondSeleniumTest : IClassFixture<WebDriverFixture>
The above test class will run in sequential mode while executing test in either commandline or via any Test explorer of IDEs
Video Demo
Here is the complete video demo