Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Selenium WebDriver's default implicit wait value?

What is Selenium WebDriver's default implicit wait value?

The selenium documentation says that it is "0" but when I call .findElement on a brand new project, where a element doesn't exist on the DOM, it seems to get a TimeoutException after a while rather than hang indefinitely. Does "0" mean wait forever or not?

like image 672
djangofan Avatar asked Mar 18 '23 10:03

djangofan


2 Answers

The default value for implicit waits is indeed zero, which means (and always has meant) "fail findElement immediately if the element can't be found." You shouldn't be receiving a TimeoutException directly from findElement. You'll likely only be receiving that when using a so-called "explicit wait", using the WebDriverWait construct.

like image 78
JimEvans Avatar answered Apr 06 '23 15:04

JimEvans


I believe, in SeleniumBasic at least, the implicit wait is 3000ms, or 3 seconds. You can find out for yourself by simply using msgbox(driver.timeouts.implicitwait()).

like image 45
kev Avatar answered Apr 06 '23 14:04

kev