Running testng.xml using Eclipse
In our previous blog we have learnt how to run testng.xml using command prompt. Now, in this blog will learn running testng.xml using eclipse IDE. This is one of the ways to execute the automation scripts using testng.xml configuration file.
Below are the steps to running testng.xml using Eclipse:
1. Open Eclipse.
2. Go to the Project where we have created the testng.xml file.
3. Right click on the testng.xml file, then you can see the below screen
4. Then Select the options : Run As → TestNG Suite
5. Then it will execute the scripts as TestNG Suite.
6. After executing the testng.xml file, it will give the below report.
This is the simplest way to execute the scripts using eclipse. Before running the suite, we can open the testng.xml file and can do the modifications or configurations as per the need and can execute the scripts from the eclipse. Then it will give you the report next to console section as a separate tab called “Results of running suite”. Here we can see the status of the executed tests and can see statistics like how many tests got passes. failed and skipped.
Compare to running the command prompt it is the easiest way to execute the scripts. But both the ways have their own advantages. It purely depends on the requirement how we want to execute the scripts.