Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
The timeOut attribute in TestNG is used to determine the maximum time permitted for a test method to execute. If the test method takes longer than the given time, TestNG will label it as a failed test and terminate the execution. The value of the timeout attribute defines in milliseconds. For example, if you put the value of 5000 with the timeOut attribute test will end if it prolongs more than 5000 milliseconds or 5 seconds.
Here is an example of a timeOut attribute:
@Test(timeOut = 5000)
public void testMethod() {
// test method code goes here
}
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.