“--忽略证书错误”开关不适用于 Chrome 15

发布于 2024-12-14 07:14:06 字数 516 浏览 1 评论 0原文

我在自动化 Chrome 15 时遇到问题。

如果我使用 --ignore-certificate-errors 开关从 ruby​​ 脚本启动 Chrome,我仍然会收到证书错误提示。

我使用下一个命令启动 chrome

 browser = Watir::Browser.new :chrome, :switches => ['--ignore-certificate-errors']

它在 Chrome 14 中按预期工作。 Watir-webdriver gem 版本是 0.3.8 如果我执行

C:\Users\test\AppData\Local\Google\Chrome\Application\chrome --ignore-certificate-errors

一切都按预期工作。

目前我将降级到 Chrome 14,但如果您能提供 Chrome 15 的解决方案,我将不胜感激。

I have an issue with automating Chrome 15.

If I start Chrome from ruby script with --ignore-certificate-errors switch, I still get certificate error prompt.

I start chrome with next command

 browser = Watir::Browser.new :chrome, :switches => ['--ignore-certificate-errors']

It works as expected with Chrome 14.
Watir-webdriver gem version is 0.3.8
If i execute

C:\Users\test\AppData\Local\Google\Chrome\Application\chrome --ignore-certificate-errors

Everything works as expected.

Currently I will downgrade to Chrome 14, but will be appreciate for solution for Chrome 15.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

贪恋 2024-12-21 07:14:06

作为解决方法,我建议也许只是将自签名证书添加到测试系统上的受信任授权列表中,这样您就不会收到错误。这为您提供的体验与真实用户使用来自可信机构的正确签名的证书访问生产站点时所看到的体验类似。

它还会让您在 IE 中遇到相同的错误屏幕,该屏幕没有任何开关可以绕过该错误,而且 IE 似乎会阻止 webdriver 执行任何自动化操作,因此您甚至无法对其进行编码以单击链接继续操作无论如何,该页面。

As a workaround, I'd suggest perhaps just adding the self signed certs to the list of trusted authories on the test systems so that you don't get the error. That gives you an experience that would parallel what a real user see's when accessing a production site with a properly signed cert from a trusted authority.

It also gets you past the same error screen in IE, for which there is no switch to bypass the error and for which it seems IE blocks webdriver from doing any automation, so you can't even code it to click the link to proceed to the page anyway.

天涯沦落人 2024-12-21 07:14:06

对此的唯一答案是让 Selenium/Webdriver 项目来修复它。

建议的解决方案根本没有帮助,即使没有指定开关,webdriver 也会自动加载该开关。

错误消息的结果如下。请注意,指定了 0 个开关。

require 'rubygems'
require 'selenium-webdriver'

$RC_URL = 'http://localhost:4444/wd/hub'

capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
            capabilities["browser"] = "chrome"

        end
          $driver = Selenium::WebDriver.for(:remote,
                                        :url => $RC_server,
                                        :desired_capabilities => capabilities)
$driver.navigate.to "http://www.google.com"

The only answer to this is to get the Selenium/Webdriver project to fix it.

The solution suggested wouldn't help at all, webdriver is automatically loading that switch, even when no switches are specified.

The following results in the error message. Notice that 0 switches are specified.

require 'rubygems'
require 'selenium-webdriver'

$RC_URL = 'http://localhost:4444/wd/hub'

capabilities = Selenium::WebDriver::Remote::Capabilities.chrome
            capabilities["browser"] = "chrome"

        end
          $driver = Selenium::WebDriver.for(:remote,
                                        :url => $RC_server,
                                        :desired_capabilities => capabilities)
$driver.navigate.to "http://www.google.com"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文