Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前在 Java 中使用 Selenium 2.0a2 使用HtmlUnitDriver实例访问 Internet。我面临的问题是,当我尝试访问速度较慢的网站时,请求超时。如何增加 WebDriver 在引发超时异常之前等待的时间?
HtmlUnitDriver
等待=新的WebDriverWait(驱动程序,10);wait.until(new VisibilityOfElementLocated(By.id("whatever")));
10 是超时是秒。