Perform the following steps for executing testng.xml using Eclipse:

Open Eclipse and go to the project where we have created the testng.xml file.
Select the testng.xml file, right-click on it, and select Run As. | ...
Eclipse will execute the XML file as TestNG suite and you can see the following report in Eclipse:

Selenium online training

Java online training