Quality Testing

Quality is delighting customers

How to resolve this Selenium Website certificate issue

Hi all, 

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("override link"));, 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*");

Thanks.

Views: 68

Reply to This

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service