"webdriver-manager update" Command shows error message in Protractor - selenium

When I issue the command
webdriver-manager update while starting my protractor script execution I see below error message:
"Error: read ECONNRESET
at exports._errnoException (util.js:1020:11)
at TLSWrap.onread (net.js:568:26)"

Add proxy if your network behind proxy.
webdriver-manager update --proxy http://yourproxy:yourport.
Also add proxy for webdriver-manager start.
If you don't like to type the proxy every time, you can add HTTP_PROXY, HTTPS_PROXY and NO_PROXY Environment Variables.

It seems you are behind corporate firewall, Try below commands. It should work fine.
webdriver-manager update --ignore-ssl --proxy http://XXX.XXX.XXX:80
webdriver-manager start --ignore-ssl --proxy http://XXX.XXX.XXX:80
if both of them doesn't work. Try the below command as well.
webdriver-manager update --proxy http://XXX.XXX.XXX:8000 --ignore_ssl --gecko false

Related

Protractor installed in offline mode - error for webdriver-manager start - what am I doing wrong

I need to install and use Protractor / Selenium on the machine without Internet access.
To do that, I've tried to download all needed files and copy them to the destination machine.
On my machine (with Internet access)
I installed Protractor and Selenium webdriver with the following command:
npm install -g protractor
webdriver-manager update
On destination machine (without Internet access)
I copied all files from the location returned by npm config get prefix to the computer without Internet access.
Then I executed following command on the machine without Internet access:
npm --cache-min 9999999 install -g protractor
which seems to succeed.
However, when I try to execute webdriver-manager start command, I receive following error message:
events.js:183
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND chromedriver.storage.googleapis.com
chromedriver.storage.googleapis.com:443
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
I receive the same error when executing webdriver-manager update (as in this case: webdriver-manager start: Error: connect ETIMEDOUT)
Question
What am I doing wrong? How should I properly setup Protractor and webdriver on the machine without Internet access?
Because webdriver-manager start will look up the latest version number of selenium-server.jar and webdriver binaries through internet no matter they are already exists on local.
But webdriver-manager not supply cmd option to disable the looking up.
The quick way is to run the java cmd behind webdriver-manager start directly to skip the looking up.
java
-Dwebdriver.chrome.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\chromedriver_2.38.exe
-Dwebdriver.gecko.driver=C:\Tools\npm-global\node_modules\webdriver-manager\selenium\geckodriver-v0.20.1.exe
-jar C:\Tools\npm-global\node_modules\webdriver-manager\selenium\selenium-server-standalone-3.11.0.jar
-port 4444
The complex way is to change webdriver-manager code or setup a mirror on local and use cmd option: --alternate_cdn and point it to your local mirror url. ( I didn't verify this can work, get it after read some source code)

webdriver-manager fails to install selenium standalone

Experts,
I have following configuration
nvm - 0.33.0
node - 7.5.0
npm - 4.1.2
webdriver-manager - 12.0.6
I am behind a corporate proxy and I use cntlm. when I run the following command
webdriver-manager update --standalone --ignore_ssl --verbose --proxy="http://localhost:3190/"
I get following output
webdriver-manager: using global installed version 12.0.6
[15:08:27] I/http_utils - ignoring SSL certificate
[15:08:27] I/http_utils - ignoring SSL certificate
[15:08:27] I/http_utils - ignoring SSL certificate
(node:4132) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: response status code is not 200
(node:4132) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[15:08:28] I/update - chromedriver: unzipping chromedriver_2.33.zip
[15:08:28] I/update - chromedriver: setting permissions to 0755 for /home/ua70vv/.nvm/versions/node/v7.5.0/lib/node_modules/webdriver-manager/selenium/chromedriver_2.33
[15:08:29] I/http_utils - ignoring SSL certificate
[15:08:34] I/update - geckodriver: unzipping geckodriver-v0.19.0.tar.gz
[15:08:34] I/update - geckodriver: setting permissions to 0755 for /home/ua70vv/.nvm/versions/node/v7.5.0/lib/node_modules/webdriver-manager/selenium/geckodriver-v0.19.0
I see there is a warning.
After this when I try to run "webdriver-manager start", I still get error complaining following
E/start - Selenium Standalone is not present. Install with webdriver-manager update --standalone
Please suggest what is the error here.
Thanks in advance!
--ignore_ssl Ignore SSL certificates
--proxy Proxy to use for the install or update command
Like webdriver-manager update --ignore_ssl
This will solve your problem.
seems the standalone.jar download site not avaiable. https://selenium-release.storage.googleapis.com/
you can use java cmd to start selenium server, save below content into a start-selenium-server.cmd file on window, and change the versions and driver_home to yours. Double click it to run.
set standalone_version=3.4.0
set chromedriver_version=2.32
set geckodriver_version=v0.19.0
set driver_home=C:\Tool\npm-global\node_modules\protractor\node_modules\webdriver-manager\selenium
java -Dwebdriver.chrome.driver=%driver_home%\chromedriver_%chromedriver_version%.exe -Dwebdriver.gecko.driver=%driver_home%\geckodriver-%geckodriver_version%.exe -jar %driver_home%\selenium-server-standalone-%standalone_version%.jar -port 4444

webdriver manager not working behind proxy

I need to use webdriver-manager to execute:
webdriver-manager update --proxy=https://proxy.company.com:8080
But get
webdriver-manager: using local installed version 12.0.6
events.js:160
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:1020:11)
at TLSWrap.onread (net.js:568:26)
i.e. the proxy command still does not seem to work for 12.0.6 for me.
What worked for me was adding --ignore_ssl in addition to --proxy
webdriver-manager update --proxy=http://someproxy:8080 --ignore_ssl
As question title sounds if-you want to use webDriver manager being behind proxy then use it like below in your browser instantiation class-
WebDriverManager.chromedriver().proxy("YourProxyServerUrl:YourPort").setup();
driver = new ChromeDriver(chromeOptions-if you have);
And if you looking for:updating the selenium webdriver using the "webdriver-manager
Refer below thread -
selenium webdriver manager update - npm

Protractor Webdriver-manager update SSL error

I am getting the following errors with webdriver-manager update. My protractor is at version 5.1.1
my_local_windows_directory>webdriver-manager update
events.js:160
throw er; // Unhandled 'error' event
^
Error: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:794:
at exports._errnoException (util.js:1022:11)
at WriteWrap.afterWrite (net.js:801:14)
Any ideas to resolve this issue. I am behind a corporate Lan, but I tried BYOD network as well, but still this did not resolve.
1) Restart mac
2) Run this -> webdriver-manager update
3) Run this -> webdriver-manager start
4) Also you can check your ports sudo lsof -iTCP -sTCP:LISTEN -n -P

manually install npm packages?

I'm experimenting with protractor and following tuturial on github. NPM was already present on my system, I succesfully downloaded protractor and now I'm proceeding with
webdriver-manager update
Which fails with
downloading http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar...
Error: Got error Error: getaddrinfo ENOTFOUND from http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
Updating chromedriver
Error: Got error Error: getaddrinfo ENOTFOUND from https://chromedriver.storage.googleapis.com/2.10/chromedriver_win32.zip
downloading https://chromedriver.storage.googleapis.com/2.10/chromedriver_win32.zip...
Per earlier answered equal questions I double checked my npm proxy settings, all fine for http and https. Also I can see the username:password#proxy definition in .npmrc in my userprofile directory (c:/Users/my-name), the files are also present on the internet. Also the npm install action of protractor worked well. Now is it possible to manually (via browser download the relevant files and have them exploded and installed in the designated places?
I'm on windows 7 SP 1, 32 bit.
Yes you can manually install the webdriver-manager file in "node_modules\protractor\bin".
By the way , the error message really looks like you have a trouble to access internet.
Did you try to set these variables before launching your npm command:
set HTTP_PROXY=http://'your http proxy ip':'your proxy port'
set HTTPS_PROXY=http://'your https proxy ip':'your proxy port'
To answer my own question:
As Yannick mentioned: I only set the proxy configuration with npm config ... For this you also need to set the environment variables
set PROXY=http://<username>:<password>#proxyserver
set HTTP_PROXY=%PROXY%
set HTTPS_PROXY=%PROXY%