Tuesday 19 June 2012

How to avoid invalid certificate in selenium RC (IE)

If you are running selenium RC test with IE a site which already has invalid certificate then IE will give a warning for "invalid certificate". You can have selenium
automatically click on "Continue" link in it(which has ID of overridelink) by adding
below command in your IE specific test case.

if ((selenium.isElementPresent("//a[@id='overridelink']"))) {
selenium.click("//a[@id='overridelink']");
//selenium.waitForPageToLoad(MAX_WAIT_TIME_IN_MS);
selenium.waitForPageToLoad("30000");
}