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!!

No comments:

Post a Comment

DevOps 01: What is DevOps and How it benefits organizations?

DevOps is a culture in an organization, where the development team and operations team help each other by sharing information, process and t...