How to create 'testng.xml' using Eclipse
Created testng suite file manually as below:
- Run once your project from Eclipse
- Refresh your project
- Now, “test-output” folder will be created under your project –> unfold the folder
- 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.)
- Click on the ‘.xml’ link given on the left panel
- The test suite XML will get opened on the right-side panel
- Take a copy of the XML content
- Right click your project >> New >> File
- Give name of your test suite file (with .xml extension e.g. testng.xml) and click Finish
- 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.