dmeehan
dmeehan

Reputation: 2357

Max duration for a selenium webdriver test

Is there a way to indicate a max test duration for Selenium Webdriver, and/or if a test runs longer than a certain amount of time that it can be marked as failed and move on to the next test?

Upvotes: 0

Views: 524

Answers (1)

vins
vins

Reputation: 15370

You have not provided much details about the framework you use. I use testng. It has an option timeOut in milliseconds.

@Test(timeOut=180000)
public void timeoutTest(){
       Thread.sleep(180005); // the test fails
}

Upvotes: 1

Related Questions