Proxy 如何使用phpunit和selenium2设置代理?

Proxy 如何使用phpunit和selenium2设置代理?,proxy,phpunit,selenium-webdriver,Proxy,Phpunit,Selenium Webdriver,我找不到PHPunit的例子。我不知道该用什么函数。java有很多例子,但我找不到PHPUnit的任何例子。 我打开了http://localhost:4444/wd/hub/static/resource/hub.html 在功能中,没有代理的设置。 当我使用函数setDesiredCapabilities时,selenium总是打开的。下面是我的“代码” 请帮忙谢谢虽然这个话题很老了,但我是在谷歌搜索问题的解决方案时发现的,所以我想我会有所贡献 阅读PHPUnit Selenium2Test

我找不到PHPunit的例子。我不知道该用什么函数。java有很多例子,但我找不到PHPUnit的任何例子。 我打开了
http://localhost:4444/wd/hub/static/resource/hub.html
在功能中,没有代理的设置。 当我使用函数setDesiredCapabilities时,selenium总是打开的。下面是我的“代码”


请帮忙谢谢

虽然这个话题很老了,但我是在谷歌搜索问题的解决方案时发现的,所以我想我会有所贡献

阅读PHPUnit Selenium2TestCase的源代码,您可以看到。特别是,你会想要的

例如:

$this->setDesiredCapabilities(array(
    "proxy" => array(
        "proxyType" => "manual",
        "httpProxy" => "proxyhost.com:1337",
        "noProxy" => "dontproxy.me/please" //This one is undocumented. I'm not sure how to specify more than one
    )
));
$this->setDesiredCapabilities(array(
    "proxy" => array(
        "proxyType" => "manual",
        "httpProxy" => "proxyhost.com:1337",
        "noProxy" => "dontproxy.me/please" //This one is undocumented. I'm not sure how to specify more than one
    )
));