开发者

How to configure selenium-server to use a proxy server from Eclipse

When I ru开发者_运维技巧n my Selenium tests from Selenium-IDE everything works fine, but when I export this test to Java and run it as a JUnit test from Eclipse, I get a timeout when trying to retrieve jQuery from googleapis.

I believe this is because selenium-server overrides my proxy settings when I run it this way. I have seen some suggestions as to how to configure Selenium to use a proxy server when running from the command line, so I tried to apply this to Eclipse. I right-click on selenium-server.jar, Run As -> Run Configurations..., click on the (x)=Arguments tab, and add this to Program arguments:

-Dhttp.proxyHost=myproxy.com
-Dhttp.proxyPort=80

But this still doesn't work. Can anyone suggest how to configure SeleniumServer to use my proxy when running from Eclipse? Thanks!

Update:

I have also tried putting these arguments in the VM Arguments section, but with no results. I have officially earned the Tumbleweed badge for this question... Surely *somebody* has a suggestion!


Try setting the system properties for these as in

System.setProperty(key, value)

example

System.setProperty("http.proxyHost", "myProxyServer.com");
System.setProperty("http.proxyPort", "80");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜