开发者

How do I change the default request timeout for Selenium 2?

开发者 https://www.devze.com 2022-12-26 00:12 出处:网络
I am currently using Selenium 2.0a2 in Java to access the Internet using an HtmlUnitDriver instance. The problem I am facing is that, when I attempt to开发者_开发知识库 access slow websites, the reque

I am currently using Selenium 2.0a2 in Java to access the Internet using an HtmlUnitDriver instance. The problem I am facing is that, when I attempt to开发者_开发知识库 access slow websites, the request times out. How can I increase the time that WebDriver waits before throwing a timeout exception?


wait = new WebDriverWait(driver, 10); wait.until(new VisibilityOfElementLocated(By.id("whatever")));

10 is the timeout is seconds.

0

精彩评论

暂无评论...
验证码 换一张
取 消