Sunday, October 14, 2018

What is invocationCount in TestNG?

invocationCount: This is a TestNG attribute that defines number of times a test method should be invoked or executed before executing any other test method. If invocationCount = 5, then the test method will be executed 5 times before executing next test method.

Check the below example, In getTitle() test method we are printing the title of the website with invocationCount = 5. And we have another test method secondTest() also.

Let us execute the tests and observe results.


As shown in the above screenshot the chrome browser is invoked for 5 times and printed the website title 5 times in the console, finally it executed secondTest() test method.

Please comment your comment your queries or suggestion on this post. Thanks for reading.
#HappyLearning #HappyTesting #QABABU

No comments:

Post a Comment

Java Program 6: How to reverse a String in Java?

In this post we will discuss different methods to reverse a String in java programming. Method 1: Step 1: Read the input string using ...