如何配置 selenium-server 以使用 Eclipse 中的代理服务器
当我从 Selenium-IDE 运行 Selenium 测试时,一切正常,但是当我将此测试导出到 Java 并从 Eclipse 将其作为 JUnit 测试运行时,在尝试从 googleapis 检索 jQuery 时出现超时。
我相信这是因为当我以这种方式运行时,selenium-server 会覆盖我的代理设置。我看到了一些关于如何配置 Selenium 以在从命令行运行时使用代理服务器的建议,因此我尝试将其应用于 Eclipse。我右键单击 selenium-server.jar,运行方式 ->运行配置...,单击 (x)=参数选项卡,并将其添加到程序参数中:
-Dhttp.proxyHost=myproxy.com
-Dhttp.proxyPort=80
但这仍然不起作用。谁能建议如何配置 SeleniumServer 在从 Eclipse 运行时使用我的代理?谢谢!
更新:
我也尝试将这些参数放入 VM Arguments 部分,但没有结果。我已经因这个问题正式获得了风滚草徽章...当然*有人*有建议!
When I run 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试为这些设置系统属性
如
示例所示
Try setting the system properties for these
as in
example