Louis T Louis T - 29 days ago 28
Java Question

How to overcome SSL Certificate with Selenium WebDriver

I have to write tests which use a local page, normally we write tests on Stage. it is like:

webDriver.get("https://abc.local");


I have already added the certificate on Firefox. I have also set it in Firefox > Preferences > Security > Exceptions ... to add this page as an exception. But when I run the test, it's always stopped by certificate, so I can't open the page.

Is there anyway webDriver can bypass or suppress this certificate exception? Thanks in advance.

MSJ MSJ
Answer

Try and check guru99's guide on how to handle SSL cert error in Firefox:

http://www.guru99.com/ssl-certificate-error-handling-selenium.html#7

Basically, you can - when starting the Firefox webdriver - state that untrusted certificates are allowed so you wont get the error.