In testing, it is always important to test application in different browsers. We can perform automation on multiple browsers using selenium and testng. If there are more number of tests that need to be executed in parallel on different browsers also, we can do this using testng. And there is an other challenging task such executing tests in different browser versions and also different Operating systems. This can be achieved with Selenium Grid.
TestNG provides an ability to run test classes in parallel. By using parallel execution of classes, each class will be started and executed simultaneously in different threads.
Let us look at basic example for Parallel Execution of Classes using testng.xml.
We will create a Two classes with Two test methods each and try to execute in different threads.
Create class and name it as : TestParallelClassOne.java
TestNG provides multiple ways to execute tests in separate threads. In testng.xml, if we set 'parallel' attribute on the
If we want to run methods/classes in separate threads, we need to set 'parallel' attribute on the