Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
How can a particular group of test cases get executed in TestNG?
We can run a particular set of test cases by including a group of test cases in the execution.
Example
Testng xml files with groups.
<?xml version = "1.0" encoding = "UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name = "Tutorialspoint Test"> <test name = "Regression Cycle 1"> <groups> <run> <include name = "Smoke"/> </run> </groups> <classes> <class name = "TestParam" /> </classes> </test> </suite>
To run a group of test cases from the set of test cases, we have to define
Example
@Test(groups={"Smoke"})
public void Payment(){
System.out.println(“Payment is successful”);
}
In the Java class file only the test method with group as Smoke will be run out of the entire regression suite.
Advertisements
