Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.7k views
in Technique[技术] by (71.8m points)

selenium - Can't update chromedriver and seleniumrelease

I try to work with protractor. So I followed a small tutorial and the first thing I did:

npm install -g protractor

This will install two command line tools, protractor and webdriver-manager. But now I have to update my webdriver-manager:

webdriver-manager update

So my cmd tries to connect with https://chromedriver.storage.googleapis.com/2.14/chromedriver_win32.zip and https://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar. But it will give this error:

C:Program Files (x86)Jenkinsworkspaceestnew>webdriver-manager update
Updating selenium standalone
downloading https://selenium-release.storage.googleapis.com/2.45/selenium-server
-standalone-2.45.0.jar...
Updating chromedriver
downloading https://chromedriver.storage.googleapis.com/2.14/chromedriver_win32.
zip...
Error: Got error Error: getaddrinfo EAI_AGAIN from https://selenium-release.stor
age.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar
Error: Got error Error: getaddrinfo EAI_AGAIN from https://chromedriver.storage.
googleapis.com/2.14/chromedriver_win32.zip

Sometimes it is the EAI_AGAIN error and sometimes ENOTFOUND. But what I don't understand is that I can download the zip and the jar manually in my browser. When I surf to the URL it all works fine. But not in the cmd. Can someone help me? PS: pinging isn't possible to the url's

Update: after proxy settings I get this error:

Error: Got error Error: tunneling socket could not be established, cause=socket
hang up from https://chromedriver.storage.googleapis.com/2.14/chromedriver_win32
.zip
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It happened the same to me. The problem was due to a proxy we are using inside our company.

webdriver-manager has a parameter which is --proxy, where you can specify the proxy which the webdriver command should use. The proxy configuration which you might have in nmp (.npmrc file in your users dicrectory) won't work for webdriver-manager.

Here the example which worked out for me.

webdriver-manager --proxy http://yourproxy:8080 update

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...