3

I'm trying to log into a website and use Selenium to take a screenshot through code. So far, it's been working great except for one problem: every time I access the website, both manually and with Selenium, a popup asks me to confirm a security certificate.

The certificate is good, but I cannot for the life of me get Selenium to accept the window. I know it can deal with Alerts and accept them thusly:

driver.Navigate().GoToUrl("https://www.securewebsite.com");
driver.SwitchTo().Alert().Accept();

but the box doesn't disappear or react, and attempting to do anything with the driver besides accepting or declining the alert (with no effect) results in a Modal Dialog Present error.

I'm looking for either a way to turn off this popup or a way for Selenium to deal with it in code, preferably the latter. Let me know if I can provide any more information.

GGMG-he-him
  • 394
  • 1
  • 7
  • 26

1 Answers1

0

Alright, I couldn't figure it out, so I just disabled the popup. It's poor practice and binding the application to the specific instance of IE, but it was all I could come up with.

GGMG-he-him
  • 394
  • 1
  • 7
  • 26
  • Apparently, selenium cannot handle it you are 100% right but I've seen answers where people would use AutoIt. Maybe there's an answer there for you. – NewBie1234 Jan 05 '21 at 12:40