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 5: How to reverse given string and each word of it?

Let us understand the problem with an example, suppose "Learn Core Java" is the given string then the expected output should be &...