Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSelenium Docker NodeChrome proxy isssue #42
Comments
sushanco
changed the title from
NodeChrome proxy isssue
to
Selenium Docker NodeChrome proxy isssue
Feb 16, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rubytester
Jun 9, 2015
Contributor
Could you add an example of how you need to use it? I usually add a proxy to browser sessions I start. Maybe I am not understanding this issue. example would help
|
Could you add an example of how you need to use it? I usually add a proxy to browser sessions I start. Maybe I am not understanding this issue. example would help |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cristian-smocot
Jun 19, 2015
When you create the docker container, you should set the environment variables http_proxy, https_proxy.
That way no need to pass any proxy configuration to Chrome, it should use the environment variables.
I use Javascript (node.js) and the library dockerode to create and start my containers.
So I always set the proxies as environment variables in Javascript, when creating the container.
You could create the container manually with docker create.
This command accepts a parameter --env[] where you could set the proxy information.
Investigate more with: docker create --help
Another options could be to create another Docker image, and in the Dockerfile, set the proxies as environment variables.
Something like this:
FROM selenium/node-chrome:latest
MAINTAINER Your-Email-HERE
#set proxy information to environment
ENV http_proxy=http://user:password@proxy.corp:8080 \
https_proxy=http://user:password@proxy.corp:8080 \
HTTP_PROXY=http://user:password@proxy.corp:8080 \
HTTPS_PROXY=http://user:password@proxy.corp:8080
Hope this helps people that might not know how to set the proxy information.
cristian-smocot
commented
Jun 19, 2015
|
When you create the docker container, you should set the environment variables I use Javascript ( You could create the container manually with Another options could be to create another Docker image, and in the Dockerfile, set the proxies as environment variables.
Hope this helps people that might not know how to set the proxy information. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
sushanco
Jun 21, 2015
@cristian-smocot I spent quite a lot of time trying to use environment variables on VM and application level. Chrome doesn't pick up http_proxy environment variable. Also till now doesn't have way to pick up environment variables as such (uses --proxy-server but doesn't take credentials), take a look at this url.
https://www.chromium.org/developers/design-documents/network-settings
Considering time I had to spend on it, I had two options either to create browser profiles (which is against automation & also not very maintainable) or to white-list certain requests. I went for the latter one.
sushanco
commented
Jun 21, 2015
|
@cristian-smocot I spent quite a lot of time trying to use environment variables on VM and application level. Chrome doesn't pick up http_proxy environment variable. Also till now doesn't have way to pick up environment variables as such (uses --proxy-server but doesn't take credentials), take a look at this url. https://www.chromium.org/developers/design-documents/network-settings Considering time I had to spend on it, I had two options either to create browser profiles (which is against automation & also not very maintainable) or to white-list certain requests. I went for the latter one. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cristian-smocot
Jun 22, 2015
I'm using boot2docker v.1.6.1 on Windows, with docker v.1.61.
And in my case Crome picks up the proxy information from the system environment variables.
The image I use, is selenium/node-chrome:latest (as of 22/06/2015 latest = v.2.46.0).
cristian-smocot
commented
Jun 22, 2015
|
I'm using boot2docker v.1.6.1 on Windows, with docker v.1.61. And in my case Crome picks up the proxy information from the system environment variables. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cristian-smocot
Jul 19, 2015
I take back my previous comments.
In Docker v.1.7.1 it doesn't work anymore.
Some changes or what not, I do not know, in Docker or in this Chrome Node, made Chrome browser not read the environment variables.
To see how I fixed this Chrome proxy issue, see my answer to my own issue here #78 (comment)
cristian-smocot
commented
Jul 19, 2015
|
I take back my previous comments. To see how I fixed this Chrome proxy issue, see my answer to my own issue here #78 (comment) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexellis
commented
Nov 3, 2015
|
+1 for ENV http_proxy - this works for a non-authenticating proxy. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ashutoshmittal2309
Dec 14, 2016
I was having same exact issue and was able to resolve by using below script -
https://github.com/sjitech/proxy-login-automator
This can be inserted as part of your docker setup where the browser is running. After that, the selenium Desired Capabilities or protractor config file has to point to this proxy which authenticates with actual proxy.
ashutoshmittal2309
commented
Dec 14, 2016
|
I was having same exact issue and was able to resolve by using below script - https://github.com/sjitech/proxy-login-automator This can be inserted as part of your docker setup where the browser is running. After that, the selenium Desired Capabilities or protractor config file has to point to this proxy which authenticates with actual proxy. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
diemol
Sep 7, 2017
Member
This can be done today by either rebuilding the image following these instructions, or just by passing the http_proxy as an env var when doing docker run.
Please note that the configuration value "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", has a complete different purpose, which is to allow the possibility of overwriting the node's behaviour when handling sessions, not related at all to http proxies.
|
This can be done today by either rebuilding the image following these instructions, or just by passing the Please note that the configuration value |
sushanco commentedFeb 16, 2015
I've setup selenium grid in a private network which requires use of proxy box to access development pages, therefore I'm having to add proxy configurations to selenium docker chrome nodes.
I had a look at docker-selenium/NodeChrome/config.json (below), there isn't a key to add IP/Hostname but port is there, bit strange this. Are test team supposed to have proxy configured in test suites? Even then there should be a way to configure proxy in browser nodes. Am I missing something?
"configuration": {
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 5555,
"register": true,
"registerCycle": 5000
}