-
Notifications
You must be signed in to change notification settings - Fork 844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox 48+ (Geckodriver) not using Proxy Data #334
Comments
Hi, proxy settings works for me (however, I didn't try with Selenium 3 and Firefox 49). Are you able try it in Firefox 47.0.1 (or Firefox ESR), please? |
@aberndt exact same problem here but with ff 50.0 and selenium-server-standalone-3.0.0.jar |
So I've dived into the issue, and find multiple problems there. Basically if you rely on proxy, you right now have these options:
Also note the Geckodriver (Firefox 48+) requires passing the port as standalone property (it was part of the URL previously). I may in future add some compatibility layer; but with current php-webdriver the options are as stated above. |
Also see https://bugzilla.mozilla.org/show_bug.cgi?id=1326534 - the issue that proxy capabilities are not being read by GeckoDriver should now be fixed in Firefox, and should ship with Firefox 53. |
The Proxy should be working in Firefox 52 (with latest Selenium server and Geckodriver). Could somebody please confirm this? Also note the proxy port must now be passed separately (unlike in previous Firefox versions) using |
Proxy configuration not picked up by GeckoDriver. I tried all the options from mozilla/geckodriver#97 (see my comments there) and SeleniumHQ/selenium#2963, and still can't get it working. Selenium: 3.3.1 |
@stone8 Could you please provide the exact code you use to setup the proxy? |
@OndraM, I'm currently using Selenium: 3.3.1, geckodriver 0.15, and this is the code I use to set up the proxy, but it doesn't work.
|
Selenium 3.3.1, geckodirver 0.51, firefox 52.0:Caused by: org.openqa.selenium.SessionNotCreatedException: InvalidArgumentError: Expected [object String] "{"proxyAutoconfigUrl":null,"autodetect":false,"socksUsername":null,"socksPassword":null,"httpProxy":"xxxxxxxx.com:8888","proxyType":"MANUAL","noProxy":null,"ftpProxy":"XXXXXXcom:8888","socksProxy":"xxxxxxx.com:8888","hCode":2082351774,"class":"org.openqa.selenium.Proxy","sslProxy":"xxxxxxxx.com:8888"}" to be an object (WARNING: The server did not provide any stacktrace information)
|
Selenium 3.3.1, geckodirver 0.51, firefox 45.8.0: same code as in above msg. |
I'm desperately trying to get firefox working on using a proxy... I've tried it with Firefox 54, 47.0, 47.0.1 and ESR. Using the code which @OndraM provided (and many more variations): <?php
use WebDriver\Selector\SelectorCSS;
use Facebook\WebDriver\Remote\WebDriverCapabilityType;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
require_once(__DIR__ . '/../vendor/autoload.php');
list($scriptname, $proxyIp, $proxyPort) = $argv;
//...
$wd_host = 'http://localhost:4444/wd/hub';
$capabilities = DesiredCapabilities::firefox();
$capabilities->setCapability(
'requiredCapabilities',
[
WebDriverCapabilityType::PROXY => [
'proxyType' => 'MANUAL',
'httpProxy' => $proxyIp,
'httpProxyPort' => $proxyPort,
'sslProxy' => $proxyIp,
'sslProxyPort' => $proxyPort,
],
]
);
$driver = RemoteWebDriver::create($wd_host, $capabilities);
//...
$driver->quit(); Always getting my own IP instead of proxy IP... Using |
The firefox ESR (respectively the previous ESR, Based on Firefox 47) or Firefox 47.0.1 definitely works as expected, I personally use it :). $capabilities = DesiredCapabilities::firefox();
$capabilities->setCapability(
WebDriverCapabilityType::PROXY,
[
'proxyType' => 'manual',
'httpProxy' => 'proxy.foo.bar:8118',
'sslProxy' => 'proxy.foo.bar:8118',
]
); However, Firefox 48+ is a different story. And I confirm I did not manage to get it working with latest Firefox 54, Geckodriver 18.0 and Selenium 3.4.0. There appears to be some issue with Selenium/Geckodriver, see mozilla/geckodriver#669 Furthermore, the WebDriver specification has changed recently (like few days ago - w3c/webdriver#964), and the port will again be part of the httpProxy / sslProxy property (like is used to be previously). So I assume Geckodriver will soon follow the spec (see https://bugzilla.mozilla.org/show_bug.cgi?id=1370959). So in the end, it should work the same way as is used to work in old Firefox version. However, not yet :-(. Closing for now, because unfortunately nothing can be done from php-webdriver side - the solution is up to Mozilla / Selenium. So if you need proxy, I'm afraid you have to use the old Firefox version (47.0.1), or temporarily use Chromedriver, until a fix in Geckodriver will be done. |
FYI the port issue is being worked on here: https://bugzilla.mozilla.org/show_bug.cgi?id=1369827 |
@OndraM I'm trying to setup proxy with Firefox 47.0.1 and used your code snippet,
Nothing works for me. I'm trying to run from a Linux machine and following are the docker commands I used to start selenium grid and firefox node, docker run -d -p 4444:4444 --name selenium-hub selenium/hub:latest greatly appreciate any help, Thanks. |
Hello,
i use selenium 3 beta3 in combination with the newest Firefox (49) and the newest php-webdriver. But i can't handle it to let firefox use proxy settings. my code is as following:
111.111.111.111 is just a dummy IP, i am not allowed to write the real IP here.
It opens the Firefox and navigates to the webpage but it does not use the Proxy settings. What am i doing wrong ?
Thanks
Andreas
The text was updated successfully, but these errors were encountered: