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 to use regular expressions with TestNG?
We use regular expressions in TestNG to work with a group of test methods that are named with a certain pattern.
Example
Testng xml file.
All the test methods with starting name Payment will be excluded from the regression suite.
Example
@Test
public void PaymentHistory(){
System.out.println("Payment history validation is successful”);
}
@Test
public void Login(){
System.out.println("Login is successful”);
}
@Test
public void PaymentDefault(){
System.out.println("Payment default verification is successful”);
}
Login() will be executed, but all the methods starting with name Payment will be excluded from execution. This is achieved using regular expression(Payment.*).
Advertisements
