在IE9中,如何使用watir-webdriver跳过无效的证书屏幕? [英] In IE9, how can I use watir-webdriver to get past the invalid certificate screen?

查看:72
本文介绍了在IE9中,如何使用watir-webdriver跳过无效的证书屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是带有此网站的安全证书有问题"的屏幕.标头.这是我要单击的链接的代码:

<tr>
<td >&nbsp;</td>
<td id="continueToSiteAlign" align="left" valign="middle">
    <h4 id="continueToSite">
        <img src="red_shield.png" ID="ImgOverride" border="0" alt="Not recommended icon" class="actionIcon"><A href='' ID="overridelink" NAME="overridelink" >Continue to this website (not recommended).</A>
    </h4>
    </td>
</tr>

在带有watir的IE8中,代码browser.link(:text => /Continue/).click可以很好地单击屏幕,但是IE9中不是这种情况.相反,我得到NoMethodError: undefined method 'map' for nil:NilClass.

解决方案

请参阅我对这个问题的回答:

<tr>
<td >&nbsp;</td>
<td id="continueToSiteAlign" align="left" valign="middle">
    <h4 id="continueToSite">
        <img src="red_shield.png" ID="ImgOverride" border="0" alt="Not recommended icon" class="actionIcon"><A href='' ID="overridelink" NAME="overridelink" >Continue to this website (not recommended).</A>
    </h4>
    </td>
</tr>

In IE8 with watir, the code browser.link(:text => /Continue/).click worked fine to click through the screen, but this is not the case in IE9. Instead, I get NoMethodError: undefined method 'map' for nil:NilClass.

See my response to my own version of this question: How can we get Watir-Webdriver to work with the IE invalid cert screen?

In short, it appears that IE9 is handling this via a special page that disables most access to JavaScript and anything that a hacker might use on a malware site to automate their way around the warning. The way webdriver works is apparently close enough to what a hacker might try to do that it is also blocked in the same way.

The best solution is just to add the source of the self-signed certificates to your trusted root certification authorities so that IE will see the cert as trusted and not complain. The resulting experience more closely parallels what a real user would see when accessing a real production site with a valid certificate issued by a trusted cert authority.

这篇关于在IE9中,如何使用watir-webdriver跳过无效的证书屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆