Pages

How To Handle SSL Certificate Error In IE Browser For Selenium WebDriver Test

Earlier we learnt how to handle SSL certificate error by creating custom profile In selenium WebDriver software test when you run It In Firefox browser as described In THIS POST. IE browser do not have any such feature to create and run software test In custom profile. So you need to do something different for IE browser to resolve certificate related error when you run WebDriver software automation test.

As you know, we can resolve error "Enable protected mode for all zones" as described In THIS POST and Set IE browser Zoom Level To 100% Error as described In previous post. Now let's see how to resolved SSL certificate error In IE browser for selenium WebDriver software automation test.

When you see SSL certificate error In IE browser, Your screen will looks like bellow.

There Is one option link with text "Continue to this website (not recommended)." If somehow we can click on this link then original software website page will be loaded and our test script can go further for execution. If you view link In HTML mode using F12 then you will realize that link has ID called "overridelink". We can click on that link using driver.navigate() method with Javascript as bellow.

//To click on "Continue to this website (not recommended)." link to load original website.
driver.navigate().to("javascript:document.getElementById('overridelink').click()");

This solution Is worked for me In many website's tests. Full example demonstration Is as bellow.