-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Java+Selenium+Firefox proxy server cannot be set. #2963
Comments
duplicate of mozilla/geckodriver#97 |
Hi @lukeis, I have looked here mozilla/geckodriver#97 and in the geckodriver code ` GeckoDriver.prototype.setSessionCapabilities = function(newCaps) {
` It seems that it is looking for proxy only in 'requiredCapabilities' ` GeckoDriver.prototype.setUpProxy = function(proxy) {
So I have tried to pass them like this: ` DesiredCapabilities required = new DesiredCapabilities();
` but still no luck, I get some error.
I will try to find out why. |
Hi @lukeis, Success! I was sending:
Instead of this now I use successfully
That opens firefox asking me for the user and password for that proxy. ` DesiredCapabilities required = new DesiredCapabilities();
` Now we have the prove that proxy works with Marionette and Firefox. You should get rid of the webdriver example ` String PROXY = "localhost:8080";
or at least mark it as deprecated and add the new example with Marionette desiredCapabilities. |
Feel free to submit a patch to the website itself, I would appreciate it :) |
Work in Selenium 3.14.2, Firefox 62, C# .NET 4.5 FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(@"GeckoDriver19", "geckodriver.exe");
|
Hi,
I have a problem configuring Firefox to use proxy from selenium and java. I used a similar example with the code snippet you provided here http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp
Here is the code I use:
`
import java.io.File;
import java.io.IOException;
`
Here are the environment details, on both windows and linux:
The output on Windows is:
Where 8x.7x.22x.14x is my local ip, not proxy IP.
Similar output on Linux:
Where 5x.14x.2x.2xx is the ip of the Linux machine not the proxy.
Where is the problem? If I open the firefox "Connection Settings", the proxy option is "Use System Proxy Settings", not manual.
I have also tried a version with FirefoxProfile preferences, but no luck either.
firefoxProfile.setPreference("network.proxy.type", 1); firefoxProfile.setPreference("network.proxy.http", proxyServer); firefoxProfile.setPreference("network.proxy.http_port", proxyPort); firefoxProfile.setPreference("network.proxy.ssl", proxyServer); firefoxProfile.setPreference("network.proxy.ssl_port", proxyPort); firefoxProfile.setPreference("network.proxy.ftp", proxyServer); firefoxProfile.setPreference("network.proxy.ftp_port", proxyPort); firefoxProfile.setPreference("network.proxy.socks", proxyServer); firefoxProfile.setPreference("network.proxy.socks_port", proxyPort); firefoxProfile.setPreference("network.proxy.share_proxy_settings", true); firefoxProfile.setPreference("network.proxy.no_proxies_on", "localhost, 127.0.0.1");
The text was updated successfully, but these errors were encountered: