Can't update chromedriver and seleniumrelease

2019-01-27 14:22发布

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)\Jenkins\workspace\testnew>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

4条回答
神经病院院长
2楼-- · 2019-01-27 14:37

Your web browser is probably using a proxy, or some other indirect access to the wider internet that the webdriver-manager script isn't configured to use. (The webdriver-manager supports a --proxy parameter if you know what to pass to it.)

If you can download the files manually, just put them in the selenium directory manually. The script also unzips the "chromedriver_win32.zip" in place to get the chromedriver binary contained in it.

查看更多
迷人小祖宗
3楼-- · 2019-01-27 14:42

Read on if your webdriver-manager update doesn't update chromedriver to the latest.

I lost a few weeks pulling my hair around an issue I had with "Unable to discover open pages" and every time I would update the chromedriver, it would update to version 2.22 for chromedriver and I believe the selenium server to v2.53. My problem wasn't really with the selenium server so v2.53 was fine.

Issue was with chromedriver v2.22. 

Eventhough this chromdriver link showed that there was a latest version of 2.24, 'webdriver-manager update' would NOT pick up that latest version, it would only grab version 2.22 of the chrome driver.

How did I go around this?

Simply run the command below after you check this link for which version of chromedriver you want to update to; for instance, I wanted v2.24 so I ran the command below:

webdriver-manager update --versions.chrome 2.24

If you check your location: C:\Users\<USER>\AppData\Roaming\npm\node_modules\webdriver-manager\selenium\

You should see that the desired chromedriver was downloaded there; if it's not there, read the command prompt logs and it'll tell you where it downloaded your chromdriver files.

Hope that helps someone!

查看更多
太酷不给撩
4楼-- · 2019-01-27 14:55

If setting your proxy does not work, how it happened to me, you can download the files manually from the urls show in the console, and put them into the selenium folder

The path in Windows is:

users\username\AppData\Roaming\npm\node_modules\protractor\selenium

That works for me.

I hope that helps

查看更多
萌系小妹纸
5楼-- · 2019-01-27 14:57

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
查看更多
登录 后发表回答