Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

What does the test timeOut mean in TestNG?

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
}

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free