Creating and executing the Selenium script in parallel with TestNG

Now that we have our Selenium Grid Hub and nodes ready and configured from previous recipes, it's time to run tests in parallel with this distributed environment.

To run tests in parallel, we need a test framework that supports distributing tests on these nodes. We will use TestNG to run tests in parallel for Selenium tests developed with Java bindings.

TestNG (http://testng.org) is another popular unit testing frameworks used by the Java community after JUnit. TestNG allows us to create tests that can be executed in parallel. We can set up a group of tests or test suites and have parameters configured to run these tests in parallel. It uses a multithreading model to run tests in ...

Get Selenium Testing Tools Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.