Web驱动程序更新错误响应状态代码不是200

时间:2018-02-12 14:58:15

标签: selenium-webdriver webdriver chrome-web-driver

我试图安装webdriver-manager 发出命令

webdriver-manager update

并获得以下输出

webdriver-manager: using global installed version 12.0.6
(node:6312) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 1): Error: response status code is not 200
(node:6312) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre
cated. In the future, promise rejections that are not handled will terminate the
 Node.js process with a non-zero exit code.
(node:6312) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejec
tion id: 2): Error: response status code is not 200
[16:32:42] I/update - geckodriver: file exists C:\Users\osheikh\AppData\Roaming\
npm\node_modules\webdriver-manager\selenium\geckodriver-v0.19.1.zip
[16:32:42] I/update - geckodriver: unzipping geckodriver-v0.19.1.zip
[16:32:42] I/update - geckodriver: geckodriver-v0.19.1.exe up to date

错误响应状态代码不是200指的是

我的webdriver-manager状态输出

C:\Windows\system32>webdriver-manager status
webdriver-manager: using global installed version 12.0.6
[15:58:44] I/status - geckodriver version available: v0.19.1
[15:58:44] I/status - selenium standalone is not present
[15:58:44] I/status - chromedriver is not present
[15:58:44] I/status - IEDriverServer is not present
[15:58:44] I/status - android-sdk is not present
[15:58:44] I/status - appium is not present

我的java版本和量角器版本如下

C:\Windows\system32>java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

C:\Windows\system32>protractor --version
Version 5.3.0

2 个答案:

答案 0 :(得分:0)

尝试使用webdriver-manager更新--ignore_ssl或--proxy

答案 1 :(得分:0)

我有同样的问题,我花了几个小时来找出解决问题的方法。在错误红线之前生成的错误中,我发现了以下消息:

I/config_source - curl -oE:\sample projects\sample\node_modules\protractor\node_modules\webdriver-manager\selenium\chrome-response.xml https://chromedriver.storage.googleapis.com/

我在控制台上运行了这个命令(在我的例子中我使用了代理服务器,因为 googleleapis 在我的国家被阻止了)

curl -o "E:\sample projects\sample\node_modules \protractor\node_modules\webdriver-manager\selenium\chrome-response.xml" https://chromedriver.storage.googleapis.com/`enter code here`

单独运行此命令后原来的ng e2e命令执行成功! 我认为我的应用程序路径中的空格(在我的示例路径中:.../sample projects/..)导致了该错误!