Tuesday, June 20, 2017

Importance of testng.xml and How to create it?

The importance of the testng.xml file is to define the order of execution of different tests. User can put all the tests together in one testng.xml file or can create separate testng.xml files for different based on the requirement.

some of the benefits are listed below:

  • Tests can be grouped and executed as per requirement
  • Only selected tests can be executed
  • Tests can be executed in parallel
  • TestNG listeners can be implemented at Suite level
  • To Integrate TestNG framework with third party tools like Jenkins testng.xml is required

Basic testng.xml file looks like this

Creating testng.xml:

Step 1: To create testng.xml, Right click on the java class in the project (that is having tat least one test) --> TestNG --> Conver to TestNG

Step 2: A window popup will be shown, Click Finish

Step 3: You will be navigated to the previous window and you should see testng.xml file in the eclipse window as shown in the below screen shot

That's it. Let me know your comments!!


  1. Thanks for providing the information . The articles in your blog helped me a lot for improving the knowledge on the subject. Also check my small collection on this at selenium Online Training Bangalore blog


  2. This great article has really peaked my interest. I am going to book mark your blog and keep checking for new information about once per week.
    Selenium Training in chennai | Selenium Training in anna nagar | Selenium Training in omr | Selenium Training in porur | Selenium Training in tambaram | Selenium Training in velachery


Selenium4: Working with two parallel windows in Selenium Automation

A new method newWindow() is introduced in Selenium 4 (Alpha). Using this method we can open a new tab or new window from the current window...