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 comment:

  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


Java Program 6: How to reverse a String in Java?

In this post we will discuss different methods to reverse a String in java programming. Method 1: Step 1: Read the input string using ...