angular / webdriver-manager

A binary manager for E2E testing
MIT License
225 stars 115 forks source link

webdriver-manager update not using proxy #264

Open geoHeil opened 7 years ago

geoHeil commented 7 years ago

When executing webdriver-manager update I see the following logs when executing: npm run webdriver-manager --proxy https://myproxy.at:8080 update as you see:

HTTP: CONNECT selenium-release.storage.googleapis.com:443 HTTP/1.1
chromedriver.storage.googleapis.com:443 HTTP/1.1

apparently the proxy option is not used and the updater directly tries to access the internet

cnishina commented 7 years ago

Hmmmm... shouldn't it be webdriver-manager update --proxy https://myproxy.at:8080? I believe its command first then add flags after it. So far my research on this is that it won't work for geckodriver since the 302 automatically gets followed and tries to resolve. I believe if you are behind a proxy, you'll have to proxy that request as well? To turn off geckodriver on update, use webdriver-manager update --proxy https://myproxy.at:8080 --gecko false

cnishina commented 7 years ago

Please let me know what your error message is with your corporate proxy turned on for geckodriver. To get only geckodriver: webdriver-manager update --standalone false --chrome false. I'm actively trying to figure this out but writing my own proxy has had some limitations. Thanks!

geoHeil commented 7 years ago

@cnishina , I will do this when I come back from vacation in about 3 weeks and report the error to you.

georgThesis commented 7 years ago

Hi,

the first command fails with:

 webdriver-manager update --proxy https://proxy.com:8080                                                                                                  ✹ ✭ webdriver-manager: using local installed version 12.0.6
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: write EPROTO 140511707051840:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:

    at exports._errnoException (util.js:1020:11)
    at WriteWrap.afterWrite (net.js:800:14)

and standalone as well:

% webdriver-manager update --standalone false --chrome false                                                                                                    1 ↵ ✹ ✭ webdriver-manager: using local installed version 12.0.6
[17:55:09] E/downloader - undefined
[17:55:09] I/update - geckodriver: file exists /home/vagrant.../node_modules/webdriver-manager/selenium/geckodriver-v0.18.0.tar.gz
[17:55:09] I/update - geckodriver: unzipping geckodriver-v0.18.0.tar.gz
(node:54564) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, rename '/home/vagrant/..../node_modules/webdriver-manager/selenium/geckodriver' -> '/home/vagrant.../node_modules/webdriver-manager/selenium/geckodriver-v0.18.0'
sunkaraphani commented 6 years ago

Any update on this thread got struck with the same issue.

cnishina commented 6 years ago

I am unable to verify your proxy and your set up. I have written my own proxy to try this out. Now if this isn't working for you, maybe you could write a fix that works for your environment and send in a pull request! Just think, the power of open source! I'll happily review it.

Anyway, I investigated this last month. This is what I've found out: After getting the release list from github, the download link from github redirects to aws. The aws does some cert that may/may not work well with all proxies. It does not work with my proxy since I wrote it in node. Again every proxy set up could be different so I believe my version is valid.

I think the best solution is to ask geckodriver to host their downloads on a separate site instead of relying on Github. In its current state, I don't think you can proxy for geckodriver.

cnishina commented 6 years ago

@georgThesis If you want to download standalone...you'll need

webdriver-manager update --gecko false --chrome false. It appears that you were actually just trying to download gecko.

geoHeil commented 6 years ago

@cnishina thanks for trying again. your suggested command fails with the same exception.

However, this time if explicitly passing --proxy as suggested by you a couple of postings before I see a different exception:

Error: write EPROTO 139990674323264:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:797:
igniteram commented 6 years ago

@geoHeil Can you once verify that are you using http or https proxy? I had faced similar issue sometime back and got it working by correcting this.

geoHeil commented 6 years ago

I tried the suggestions - but none worked out.

Though we additionally have deployed an anti virus scanner which sometimes screws up with certificates. Ram Pasala notifications@github.com schrieb am Mi. 27. Sep. 2017 um 21:55:

@geoHeil https://github.com/geoheil Can you once verify that are you using http or https proxy? I had faced similar issue sometime back and got it working by correcting this.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/angular/webdriver-manager/issues/264#issuecomment-332637032, or mute the thread https://github.com/notifications/unsubscribe-auth/ABnc9Ni7lSfaf6AgVcwHSZjFCjEqIBQ2ks5smqgvgaJpZM4O4r4e .

beginor commented 6 years ago

Maybe it is caused by the certificates of the https proxy, I use webdriver-manager update --proxy http://127.0.0.1:8080 and it works.

If you have to use https proxy, you can try add --ignore_ssl option, like this: webdriver-manager update --ignore_ssl --proxy https://proxy.com:8080

MartinKeprta commented 6 years ago

How can i fully disable this feature before tests starts? I am facing simmilar issue with proxy. I am using following test configuration Jenkins Selenide

Problem is that after build which goes nicely starts tests... Test are failing on this : Test > Login STANDARD_ERROR [Test worker] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (java.net.SocketException) caught when processing request to {s}->https://chromedriver.storage.googleapis.com:443: Сеть недоступна [Test worker] INFO org.apache.http.impl.execchain.RetryExec - Retrying request to {s}->https://chromedriver.storage.googleapis.com:443

Please advise

beginor commented 6 years ago

@MartinKeprta When you have download the webdriver required, run e2e test with ng e2e --webdriver-update false will skip update webdriver.

Vobson commented 4 years ago

My webdriver-manager update works with the --proxy - Option. The call "webdriver-manager start" does not. Usually I get timeouts when I try to access some 1e100.net url. That is supposed to be google's tech net. No --proxy parm? I forget the proxy-parm and give a try to the env-vars HTTP_PROXY and HTTPS_PROXY: export HTTP_PROXY=myproxy:8080 and export HTTPS_PROXY=myproxy:8080. Does this work? No. code ECONNRESET. Ah, a different error. Okay that might be a proxy problem. (Allthough the webdriver-manager update command was perfect with the same proxy? Hm.) I give it another try and export HTTP_PROXY=1.2.3..4:8080 and export HTTPS_PROXY=1.2.3.4:8080. Error: Failed to make Github request, rate limit reached. BUT: More Informations, ending with INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444 I/start - Everything started Can anybody tell me how to get rid of the error? Is it necessary to get rid of it? And does this help to anybody?

Vobson commented 4 years ago

Another point: Working in a company with high level security standards i have to ask for every url i want to access. Is there a list of urls I need for protractor? I had to find out every single one, which cast lots of ressources. Is there more than .1e100.net .github.com *.amazonaws.net ist this list correct so far?