Google+

Configuring TestNG in Selenium Java Project

In order to use TestNG in Selenium Java Project, we have to perform the below tasks:

  • Installing TestNG in Eclipse IDE ( Click here to understand )
  • Configuring TestNG in Selenium Java Project ( Follow below content to understand)

Configuring TestNG in Selenium Java Project

In order to configure TestNG in Selenium Java Project, first we need to configure Java Project with Selenium. If you dont know how to configure Selenium in a Java Project, go through the below post:

In order to configure the TestNG in Selenium Java Project, we need to first download the TestNG jar file and configure them in the Selenium Java Project. Now, follow the below steps for configuring TestNG in Selenium Java Projects:

1. Open the Selenium Java Project as shown below:



2. Open mvnrepository.com in any browser as shown below:



3. Type text "TestNG" into the search box field and click on 'Search' button. On searching, observe that "TestNG" will be displayed in the search results as shown below:



4. Click on the 'TestNG' from the search results as shown below:



5. In the resultant page of TestNG, click on the latest version of TestNG as shown below:



6. In the resultant page of the latest version of TestNG, click on the 'Download' link as shown below:



7. Observe that the latest version of TestNG Jar file will be downloaded as shown below:



8. Copy the downloaded TestNG jar file as shown below:



9. Paste into the 'libraries' folder of the Selenium Java Project as shown below:



10. Right click on the Selenium Java Project and select 'Build Path' > 'Configure Build Path' option as shown below:



11. In the resultant 'Properties' dialog, click on 'Add Jars' button as shown below:



12. In the resultant 'Jar Selection' dialog, click on 'testng' jar file followed by 'OK' and 'Apply' buttons as shown below:



13. Observe that the TestNG jar file in the 'libraries' folder of the Selenium Java project got configured successfully as shown below:



Conclusion

Hence for configuring the TestNG in Selenium Java Project, we have to first download the TestNG jar file and configure it in the Selenium Java Project. 

No comments: