Parallel and Sequential Test execution with XUnit and Selenium

ExecuteAutomation
1 min readSep 29, 2021

--

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 with Selenium

Sharing Selenium WebDriver Context in XUnit with DI

Data Driven Testing in XUnit for Selenium tests

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

--

--

ExecuteAutomation
ExecuteAutomation

Written by ExecuteAutomation

ExecuteAutomation Ltd is a Software testing and its related information service company founded in 2020. Info available in YouTube and Udemy as video courses .

No responses yet