4

我正在尝试通过发出命令来安装 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
4

2 回答 2

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/..)导致了这个错误!

于 2021-04-23T17:08:48.787 回答
0

尝试 webdriver-manager update --ignore_ssl 或 --proxy

于 2018-12-19T17:12:12.810 回答