invocationTimeOut: This is a TestNG attribute that defines the maximum period of time that a test method with invocationCount should take to execute/invoke a test method. If the invocationTimeOut has reached before invoking the test method for invocationCount then an exception (ThreadTimeOutException) will be thrown.
And invocationTimeOut should always used with invocationCount otherwise it will be ignored. Let us understand invocationTimeOut with examples.
Example 1: Give invocationCount = 4, invocationTimeOut = 3000 milli seconds.
Let us execute and observe the result.
As shown in the above screenshot the test is executed 4 times with in the 3000 millis seconds (invocationTimeOut).
Example 2: Give invocationCount = 4, invocationTimeOut = 3000 milli seconds with delay of 1 second.
Let us execute and observe the result.
The test is executed only 3 times out 4 times with in the given 3000 millis seconds (invocationTimeOut) and an exception "ThreadTimeOutException" was thrown as shown in the below screenshot.
And invocationTimeOut should always used with invocationCount otherwise it will be ignored. Let us understand invocationTimeOut with examples.
Example 1: Give invocationCount = 4, invocationTimeOut = 3000 milli seconds.
Let us execute and observe the result.
As shown in the above screenshot the test is executed 4 times with in the 3000 millis seconds (invocationTimeOut).
Example 2: Give invocationCount = 4, invocationTimeOut = 3000 milli seconds with delay of 1 second.
Let us execute and observe the result.
The test is executed only 3 times out 4 times with in the given 3000 millis seconds (invocationTimeOut) and an exception "ThreadTimeOutException" was thrown as shown in the below screenshot.
Your post is really very helpful. Easy to learn as you explain things precisely. Thank you so much.
ReplyDeleteselenium training in chennai