Question

I am using webdriver api (Selenium) and when I am trying to test a site (which I can view and browse normally in my browsers), I get the following message over and over.

INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection timed out: connect
18-Aug-2010 12:36:08 AM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry

Why do I keep getting this error ?

Was it helpful?

Solution

It looks like you have to configure a proxy. I get the same error if none is configured.

If you use the HtmlUnitDriver (You have to use the concrete implementation of WebDriver to access the setProxy method:

HtmlUnitDriver d = new HtmlUnitDriver();
d.setProxy("your.proxy.here", proxyPort);

If you use the FirefoxDriver:

FirefoxProfile firefoxProfile = new FirefoxProfile();
Proxy proxy = new Proxy();
proxy.setHttpProxy("your.proxy.here:proxyPort");
firefoxProfile.setProxyPreferences(proxy);
WebDriver driver = new FirefoxDriver(firefoxProfile);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top