How to create 'testng.xml' using Eclipse

Created testng suite file manually as below:

  1. Run once your project from Eclipse
  2. Refresh your project
  3. Now, “test-output” folder will be created under your project –> unfold the folder
  4. Double click the ‘index.html’ file -> It will be opened in the Eclipse Browser window or any other external browser (e.g. IE, Google Chrome, FF, MS Edge etc.)
  5. Click on the ‘.xml’ link given on the left panel
  6. The test suite XML will get opened on the right-side panel
  7. Take a copy of the XML content
  8. Right click your project >> New >> File
  9. Give name of your test suite file (with .xml extension e.g. testng.xml) and click Finish
  10. Paste the content that you copied from the ‘index.html’ and amend your suite file as per your needs

  • Step 1 : Select your project folder in which you have all the packages.
  • Step 2 : Right click on selected project folder
  • Step 3 : Mouse hover on TestNG option from the given list which is located at the bottom.
  • Step 4 : Select "Convert to TestNG" option
  • Step 5 : A modal will appear with the name of "Generate testng.xml"
  • Step 6 : Click on Finish button to complete the process.