This is the screen with the “There is a problem with this website’s security certificate.” header. Here is the code for the link I’m trying to click:
<tr>
<td > </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.