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

Katalon 08: Integration of HP ALM with Katalon Studio

In this post, this post we discuss about integration of  HP ALM with Katalon Studio. If we can integrate HP ALM with Katalon we can update ...