views:

32

answers:

1

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 ?

+1  A: 

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);
michael.kebe
hi I don't understand why I need a proxy because I am trying to run the test on my application and my computer IP is not blocked.
Kim Jong Woo
Then please give us more information. See comment at the top.
michael.kebe
I understand now. I realized the application was loading advertisements that was lagging out. do I always have to specify a firefox profile for each instances ? if I want to run multiple firefox instances, can I use the same profile ?
Kim Jong Woo