-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
'noProxy' capability requires to be a list by webdriver spec but is only handled as string #5004
Comments
FYI I just pushed some JS changes related to this in 661a196 |
Btw. the actual |
cc @shs96c |
For all of you, who are still messing around with setting up "noProxy" via Proxy class, I found a workaround:
Use the FirefoxProfile to set up the no proxy preference. Edit: |
This works fine with Ruby - user is free to define proxy as a string or Selenium::WebDriver.logger.level = :debug
proxy = Selenium::WebDriver::Proxy.new
proxy.no_proxy = ["localhost", "123.34.54.*", "andsoon.com"]
caps = Selenium::WebDriver::Remote::Capabilities.firefox(proxy: proxy)
driver = Selenium::WebDriver.for(:firefox, desired_capabilities: caps)
# 2018-03-02 11:46:35 INFO Selenium -> POST session
# 2018-03-02 11:46:35 INFO Selenium >>> http://127.0.0.1:4444/session | {"desiredCapabilities":{"browserName":"firefox","version":"","platform":"ANY","javascriptEnabled":true,"cssSelectorsEnabled":true,"takesScreenshot":true,"nativeEvents":false,"rotatable":false,"proxy":{"proxyType":"MANUAL","noProxy":["localhost","123.34.54.*","andsoon.com"]},"moz:firefoxOptions":{}},"capabilities":{"firstMatch":[{"proxy":{"proxyType":"manual","noProxy":["localhost","123.34.54.*","andsoon.com"]},"browserName":"firefox","moz:firefoxOptions":{}}]}}
# 2018-03-02 11:46:35 DEBUG Selenium > {"Accept"=>"application/json", "Content-Type"=>"application/json; charset=utf-8", "Content-Length"=>"465"}
# 1519969597947 Marionette INFO Listening on port 49629
# 1519969598018 Marionette INFO Proxy settings initialised: {"proxyType":"manual","noProxy":["localhost","123.34.54.*","andsoon.com"]} With 62744b3, |
This was fixed for .NET in f454a5c |
This was fixed in Java too, it supports now both legacy and W3C formats of Proxy. |
Hello, JAva code in https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/Proxy.java#L76 returns a List for noProxy in toJSON method But with RemoteDriver working with https://github.com/SeleniumHQ/docker-selenium/releases/tag/3.12.0-boron in FIREFOX somethings happens with marionette geckodriver serialization and I'm taking a error: 1529167282737 geckodriver INFO geckodriver 0.20.1 Thanks |
I can confirm. It is still not fixed, but you can use this workaround: |
Thanks, workaround works |
Confirm that it does not work in NodeJS (Nightwatch) either. nightwatchjs/nightwatch#1855 Does anyone have a work around for NodeJS? |
I am having trouble getting the workaround given for Java to work. Proxy does not seem to take effect and the proxy dialog asking for username and password keeps popping up Any thoughts ? |
@remeltucker if you are referring to proxy authentication this hasn't been implemented yet in Marionette. |
I am referring to firefox not bypassing proxies even though I specified the proxy url and the no proxy list as mentioned in the work around here https://github.com/SeleniumHQ/selenium/issues/5004#issuecomment-356313996 Is there anything else I need to do if am executing on a dockerized selenium grid setup running on linux machines? |
@remeltucker if you are using a Docker container or a linux OS for your selenium node you can set the proxy and no_proxy environment variables. |
There is no workaround necessary anymore since Firefox 57. So everything should be done via the proxy capabilities. See https://github.com/mozilla/geckodriver/#proxy-object. If that is not working a trace log is necessary, and make sure that the hosts as specified for |
Tried the below for sending proxy capabilities
Exception observed as shown below Test Console logs (Node logs given below) Message: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Console Log from the Firefox Node 19:20:00.510 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0' Note: Hope this helps. Having issues getting the trace logs. Will try again if this info doesn't help. |
@remeltucker Please upgrade to 3.14 and retest |
The trace log looks fine. So do what @barancev suggested first, and if it still doesn't work please open |
Retested in 3.14 and I did not get the java exception as mentioned earlier and was able to pass the noproxy as a list. Am I missing something ? if not, is there any recommended workarounds? Node Logs 12:57:13.806 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.14.0', revision: 'aacccce0' |
I mean, upgrade you client WebDriver library, the log above shows you're using version 3.12 |
Where are you seeing 3.12? I am seeing 3.14 . Message: org.openqa.selenium.UnhandledAlertException: : |
@remeltucker So it's not @whimboo, can you please look at the marionette log. |
I feel the last comments drift away the original reason why this issue was filed. So @remeltucker if it still not works and you can finally give me a response to my request for the Here your problem is offtopic. Thanks. |
My comment post the ask to retest does mention that the network.proxy.no_proxies_on preference value is not updated. Sorry if it was not clear.I have filed an issue for geckodriver (mozilla/geckodriver#1365) |
Given by the webdriver spec the
noProxy
capability has to be a list:https://w3c.github.io/webdriver/webdriver-spec.html#proxy
Currently at least the Java binding is forcing the entry to a string type, which causes problems with drivers (like geckodriver) which implement the behavior as given by the spec.
As it looks like some kind of wrapper is necessary to keep both old drivers and wdspec compliant drivers to work.
Here the code in question:
https://github.com/SeleniumHQ/selenium/blob/master/java/client/src/org/openqa/selenium/Proxy.java#L76
@shs96c can you please have a look?
The text was updated successfully, but these errors were encountered: