且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Selenium WebDriver的默认隐式等待值是多少?

更新时间:2022-12-14 15:09:57

隐式等待的默认值确实为零,这意味着(并且一直意味着)如果找不到该元素,则会立即使findElement失败. "您不应该直接从findElement收到TimeoutException.使用WebDriverWait构造,在使用所谓的显式等待"时,您可能只会收到该信息.

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.