Time for action – getting our tests running in parallel - Selenium

Now we are ready to start having our tests running in parallel.

  1. Open your TestNG XML configuration file.

  2. Add parallel=methods to the suite node.

  3. Add thread-count=3 to the suite node. This will run your tests with three threads. This number can be any value that you want. It is best practice to only let this number go to the number of cores that the machine running the tests has minus the number of Selenium Remote Controls running.

  4. Right-click on the configuration file in IDEA and run the tests.

What just happened?

We have just managed to get our tests running in parallel. As you can see this has been fairly easy. We saw that adding the parallel and the thread-count attributes allows us to run these tests in parallel and when coupled with Selenium Grid we can start to get our tests running near 1/n which is where we want our tests to be.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics