How to Setup TestNG with Selenium WebDriver in Eclipse IDE?

In this post I will explain how to setup TestNG in eclipse IDE and then use it for writing your tests in Selenium Webdriver.

What is TestNG? – TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionality that makes it more powerful and easier to use. Some of the functionality in TestNG which makes it more efficient testing framework is as follows:


  1. Support for Annotations.
  2. Support for data-driven testing (with @DataProvider).
  3. Flexible test configuration.
  4. Ability to re-execute failed test cases.

How to setup TestNG in eclipse IDE?

1. Launch eclipse IDE

2. Click on Help->Install New software


3. Type “” in the Work with text box and click add.

4. Write TestNG in name text box and click OK.

5. TestNG should get displayed under the name section, select the TestNG check box, click next and finish installation.

6. Restart eclipse to finalize installation.

After restarting eclipse TestNG will get configured automatically in eclipse IDE.

In the next post, I will explain how to write the Selenium WebDriver test in Eclipse IDE and use TestNG to execute that test.