What is Parallel Execution in Selenium? – DevstringxAnkush Chaudhary
In parallel testNG or parallel execution, we can run numerous tests at the same time in different threads so that it can reduce the execution time.
Where test cases are run on numerous browsers or operating systems. Basically, parallel execution helps us to reduce the time and effort of the testing.
It is most commonly used with Selenium, because of the increase in demand for the Cross Browser Testing and we can run Independent test cases only.
With TestNG, we can run test cases in parallel before we have to run test cases sequentially which is time-consuming.
TestNG provides multiple ways for the execution of our tests in separate threads simply by using a parallel attribute in the testng.xml file in the system.
Parallel Tests, Classes, and Methods:
Use parallel attribute on the <suite> tag respectively (for methods,test,classes, instances).
By using parallel attributes we can run methods, tests, and classes in parallel.
The syntax is
How to Created Parallel Suite?
Below I have created Two test classes and created a parallel suite.
Recommend to Read:- TestNg Listeners and Types of Listeners in TestNg