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
What is the purpose of the testng.xml file?
The testng.xml file has the numerous uses as listed below −
Test cases are executed in groups.
Test methods can be included or excluded in the execution.
The execution of multiple test cases from multiple java class files can be triggered.
Comprises names of the folder, class, method.
Capable of triggering parallel execution.
Test methods belonging to groups can be included or excluded in the execution.
Example
TestNG.xml file
Here as per the xml file, all the test methods with starting name Login will be excluded from test execution.
Example
@Test
public void VerifyPay(){
System.out.println("Verify payment is successful”);
}
@Test
public void LoginAdmin(){
System.out.println("Login is successful in admin”);
}
@Test
public void LoginSystem(){
System.out.println("Login is successful”);
}
Here as per the java class file, only VerifyPay() will be executed since all methods starting with name Login will be excluded from test execution.
Advertisements
