更新时间:2022-03-04 08:51:33
我认为您正在为驾驶员设置隐式等待时间:
I think you're looking for setting the implitic wait time for your driver:
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
对于可以使用的简单情况,对于更高级的自动化,我将其更改为显式等待(使用WebDriverWait
).
For simple cases thats ok to use, for more advanced automation, I'd change it to an explicit wait (using WebDriverWait
).
更多等待: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp