不支持的命令行标志:–ignore-certificate-errors(在Ruby中)
在
RubyMine和chromedriver 2.10中使用Ruby 2.0.0 p481
当Chrome启动时,它会在黄色弹出栏中显示一条消息:“您正在使用不受支持的命令行标记:–ignore-certificate-errors.稳定性和安全性将受到影响.”这个简单的例子再现了这个问题. require "selenium-webdriver" driver = Selenium::WebDriver.for :chrome driver.navigate.to login_url Java和Python已经回答了这个问题.我到处寻找Ruby模拟器.有没有人有建议或知道如何将Python答案(Unsupported command-line flag: –ignore-certificate-errors)翻译成Ruby?谢谢! 解决方法
Ruby selenium-webdriver API不公开单独的Chrome选项对象,如Java / Python,但您可以通过
“Capabilities”设置选项.
Capabilities web page提供了一个Ruby示例和您可以注入的table of recognized capabilities.将它们与excludeSwitches一起插入: caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"excludeSwitches" => [ "--ignore-certificate-errors" ]}) driver = Selenium::WebDriver.for :chrome,desired_capabilities: caps 看看Watir,它也是WebDriver的前端. 该主题也有一个chromedriver问题.有一些帖子详细说明您可以添加–test-type参数来解决证书问题和ruby code examples,如上所述. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |