Google+

Installing TestNG in Eclipse IDE for Selenium

TestNG is a Unit Testing Framework, which plays a major role in developing Test Automation frameworks for Selenium using Java Programming language.

If we are using Java programming language in Selenium Automation tests, then we have to choose either JUnit or TestNG as our Unit Testing Framework. But in Selenium Project, TestNG is preferred over JUnit, as  TestNG Unit Testing Framework is more powerful and is very much suitable for Selenium Projects.



Installing TestNG in Eclipse IDE for Selenium

In order to use TestNG with Selenium, we need to first install it in Eclipse IDE. Follow the below steps for installing TestNG in Eclipse IDE:

1. Launch Eclipse IDE as shown below:



2. Click on 'Help' menu and select 'Install New Software' option as shown below:



3. 'Install' dialog will be displayed as shown below:



4. In the 'Work with' field, type http://beust.com/eclipse as shown below:


Note: You can also type 'TestNG' in the above text box field and Eclipse IDE will automatically suggest the http://beust.com/eclipse URL. i.e. You dont have remember it, simply type 'TestNG' instead of URL will do the Job.

5. Observe that after a while, 'TestNG' option will be displayed as shown below:



6. Select 'TestNG' option and click on 'Next' button as shown below:



7. After a while, the 'Installation Details' for TestNG will be displayed and click on 'Next' button as shown below:



8. 'Review Licenses' dialog will be displayed, select 'I accept ...' radio option and click on 'Next' button as shown below:



9. TestNG installation will begin as shown below:



10. After a while, a 'Security Warning' dialog with 'OK' and 'Cancel' buttons will be displayed. Click on the 'OK' button as shown below:



11. After a while, a 'Software Updates' dialog will be displayed, asking to restart the Eclipse IDE will be displayed. Click on 'Yes' button on the dialog as shown below:



12. Eclipse IDE will get restarted and be displayed as shown below:



13. Now lets confirm whether the TestNG got installed in Eclipse IDE or not. Click 'Window' menu and select 'Show View' > 'Other' option as shown below:



14. 'Show View' dialog will be displayed. Expand 'Java' folder and observe that 'TestNG' option will be available as shown below:



Hence it is confirmed that 'TestNG' required by Selenium, got successfully installed in Eclipse IDE.

Conclusion:

In order to use TestNG in Selenium Projects, we have to first install TestNG in Eclipse IDE.

No comments: