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 execute a particular test method multiple times (say 5 times) innTestNG?
We can execute a particular test method multiple times (say 5 times) with the help of the invocationCount helper attribute.
Example
@Test
public void PaymentDetails(){
System.out.println("Payment details validation is successful”);
}
@Test(invocationCount=5)
public void LoginAdmin(){
System.out.println("Login in admin is successful”);
}
@Test
public void LeaseDetails(){
System.out.println("Lease details verification is successful”);
}
In the Java class file, the LoginAdmin() method with invocationCount set to 5 will result in Login in admin is a successful message to be printed five times on the console.
Advertisements
