Multiple class execution using TestNG xml

One of the important feature of running test cases from testng.xml is that we can execute test cases from multiple classes in one go. We can include multiple classes together. Below is the simple example of testng xml file which includes multiple classes.

Here, in above xml file, there are two classes which are included in classes tag namely TestClass1 and TestClass2.

Code for TestClass1:

Code for TestClass2:

Result of above Execution:


HTML report for above execution:


PS: For any questions queries or comment feel free to write us at or Happy Learning 🙂

Saurabh Dhingra

About the Author

Saurabh Dhingra

Follow Saurabh Dhingra: