How to run the same method multiple times using the invocationCount in TestNG
File: KWTestNG.java
Output
[RemoteTestNG] detected TestNG version 7.0.0 Login Successful Login Successful Login Successful PASSED: NavigateLogin PASSED: NavigateLogin PASSED: NavigateLogin =============================================== Default test Tests run: 3, Failures: 0, Skips: 0 =============================================== =============================================== Default suite Total tests run: 3, Passes: 3, Failures: 0, Skips: 0 =============================================== Default test ( 60.167 s) NavigateLogin 1/3 (21.198 s) NavigateLogin 2/3 (19.704 s) NavigateLogin 3/3 (19.265 s)
What Next?
How to perform load testing using the invocationCount and threadPoolSize parameters in TestNG
How to use TestNG Parameters and Data Provider for Data Driven Testing
How to run parallel tests with Selenium WebDriver and TestNG
Advertisement