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

前端 未结 5 1295
轮回少年
轮回少年 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 12:57

    Implicit waits are set once and apply throughout the life of the driver instance so there is no real replacement for that line. You should just remove it because you don't want to mix implicit and explicit waits according to the official docs.

    WARNING: Do not mix implicit and explicit waits. Doing so can cause unpredictable wait times.

    Once you remove that line, you will need to run your scripts and add explicit waits in the areas where a wait is needed.

提交回复
热议问题