【问题标题】:How to configure selenium-server to use a proxy server from Eclipse如何配置 selenium-server 以使用 Eclipse 中的代理服务器
【发布时间】:2010-11-10 16:00:40
【问题描述】:

当我从 Selenium-IDE 运行我的 Selenium 测试时,一切正常,但是当我将此测试导出到 Java 并从 Eclipse 作为 JUnit 测试运行时,我尝试从 googleapis 检索 jQuery 时出现超时。

我相信这是因为当我以这种方式运行 selenium-server 时,它会覆盖我的代理设置。我已经看到了一些关于如何配置 Selenium 以在从命令行运行时使用代理服务器的建议,因此我尝试将其应用于 Eclipse。我右键单击 selenium-server.jar,运行方式 -> 运行配置...,单击 (x)=Arguments 选项卡,并将其添加到程序参数中:

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

但这仍然不起作用。任何人都可以建议如何配置 SeleniumServer 以在从 Eclipse 运行时使用我的代理?谢谢!

更新:

我也尝试将这些参数放在 VM 参数部分,但没有结果。我已经正式为这个问题赢得了 Tumbleweed 徽章...肯定*有人*有建议!

【问题讨论】:

    标签: eclipse spring-mvc junit selenium-rc


    【解决方案1】:

    尝试为这些设置系统属性 如

    System.setProperty(key, value)
    

    例子

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

    【讨论】:

      猜你喜欢
      • 2013-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-18
      • 2018-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多