forked from php-webdriver/php-webdriver
-
Notifications
You must be signed in to change notification settings - Fork 0
HowTo Work with proxy
RobinDev edited this page Nov 19, 2014
·
4 revisions
Example for an HTTP and SSL proxy
$wd_host = 'http://localhost:4444/wd/hub';
$capabilities = array(WebDriverCapabilityType::BROWSER_NAME => 'firefox',
WebDriverCapabilityType::PROXY => array('proxyType' => 'manual',
'httpProxy' => '127.0.0.1:2043', 'sslProxy' => '127.0.0.1:2043'));
$driver = RemoteWebDriver::create($wd_host, $capabilities);
See https://code.google.com/p/selenium/wiki/DesiredCapabilities#Proxy_JSON_Object for more options.
To use a proxy with a basic authentication for Chrome/Chromium, you need tu use a plugin. Details https://github.com/RobinDev/Selenium-Chrome-HTTP-Private-Proxy