gpt4 book ai didi

selenium - 错误 : self signed certificate in certificate chain

转载 作者:行者123 更新时间:2023-12-05 09:18:50 27 4
gpt4 key购买 nike

我可以通过重新启动我的 Windows 7 来运行 selenium 服务器。但是,如果我终止服务器并再次启动它,我将收到此错误。有时执行 webdriver-manager update--ignore_ssl 可能会解决问题,但大多数时候不会解决。有什么想法吗?

我在 Windows 7 x64 上运行它。

C:\Users\...> webdriver-manager start --ignore_ssl
events.js:163
throw er; // Unhandled 'error' event
^

Error: self signed certificate in certificate chain
at TLSSocket.<anonymous> (_tls_wrap.js:1084:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:188:7)
at TLSSocket._finishInit (_tls_wrap.js:606:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:436:38)

最佳答案

大多数情况下,在 webdriver-manager 更新期间清除缓存并忽略 ssl 即可解决问题

npm cache clean
webdriver-manager update --ignore_ssl

在我的例子中,我通过在项目中本地更新 webdriver manage 并启动独立服务器来解决

package.json

"scripts": {
"webdrivermanager:update": "node node_modules/protractor/bin/webdriver-manager update --versions.standalone=3.2.0 --ignore_ssl",
"webdrivermanager:clean": "node node_modules/protractor/bin/webdriver-manager clean",
"install": "npm run webdrivermanager:clean && npm run webdrivermanager:update"
}

protractor configuration file

seleniumServerJar: 'node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.2.0.jar',

npm install 第一次更新你的 webdriver-manager,每次你需要的时候只需发出命令 protractor protractor.conf.js

关于selenium - 错误 : self signed certificate in certificate chain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43194545/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com