Replace implicit wait with explicit wait (selenium webdriver & java)

前端 未结 5 1379
轮回少年
轮回少年 2020-11-22 12:37

How can I replace this implicit wait with an explicit one?

driver = new ChromeDriver(capabilities);

driver.manage().deleteAllCookies();

5条回答
  •  甜味超标
    2020-11-22 13:09

    Implicit wait is defined once right after the driver initialization for the driver life time, and it sets the maximum amount of time for the driver to look foe WebElement.

    Explicit wait is used to wait up to the given amount of time for the WebElement to be in cretin condition, and need to be used each time you are waiting for condition to met.

    You can't "replace" the implicit wait definition with explicit wait, as they are different thing and there is no condition to wait for in this point.

提交回复
热议问题