I am working on Selenium 2 & C#. I have a certificate problem in IE9. I am executing my Selenium Test script and get to the page: “There is a problem with this website’s security certificate”.
When I tried to click the link “Continue to this website (not recommended)” using: driver.FindElement(By.Id("overridelink"));, Selenium didn’t recognize it, it couldn’t click the link.
Would you please let me know if someone knows how to fix this issue?
This is my code:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.SetCapability(CapabilityType.AcceptSslCertificates, true);
WebDriverObj = new InternetExplorerDriver(capabilities);
MyBrowser = new WebDriverBackedSelenium(WebDriverObj, "http://www.google.com");
WebDriverObj.Navigate().GoToUrl("https://mywebsiteUrl");
WebDriverObj.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()");
IWebElement uname = WebDriverObj.FindElement(By.Id("ctl00_uxContentPlaceHolder_uxUsername"));
uname.SendKeys("username");
IWebElement pwd = WebDriverObj.FindElement(By.Id("ctl00_uxContentPlaceHolder_uxPassword"));
pwd.SendKeys("pass*");
Here is the python version that I found somewhere:
Now just call certificate_continue() after you call the driver.get to the SSL url. This worked (works) for me with ie9.
Hope this helps
A