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

DevOps 01: What is DevOps and How it benefits organizations?

DevOps is a culture in an organization, where the development team and operations team help each other by sharing information, process and t...