Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
1.9k views
by The go-to Tester (344 points)
What is the use of the @test method invocationCount in TestNG

1 Answer

0 like 0 dislike
by The go-to Tester (142 points)
Invocation count is used when you want to run the same tests multiple times. Below example illustrates how to use invocation count in TestNG.

Say, you have a test that you want to repeat multiple times to make sure that it works fine, you can specify invocationCount to invoke a test with specified test data multiple times.

E.g.

@Test(invocationCount = 5) will execute your same test 5 times.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...