Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create 'testng.xml' using Eclipse

I am new to TestNG and Selenium Webdriver and trying to create a testng.xml using eclipse.

Done some research in www and understand that this file can be created by doing Right Click on the Java class >> TestNG >> Convert to TestNG

However this Convert Refactoring wizard is not opening.

Whether this wizard will not open, if the Java class already contains @Test annotations (!?)

Can you help me to create testng.xml using eclipse please.

(I am using Eclipse Luna)

like image 342
PraveenKS Avatar asked May 21 '15 14:05

PraveenKS


1 Answers

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
like image 188
PraveenKS Avatar answered Sep 17 '22 16:09

PraveenKS