How does Selenium Webdriver handle the SSL certificate in Edge?

We can handle SSL certificates in Edge browser with Selenium webdriver. This is done with the help of the EdgeOptions class. We shall create an object of this class and set the parameter setAcceptInsecureCerts to the true value.

Finally, this information has to be passed to the webdriver object to get the desired browser settings. An SSL is a protocol designed to establish a secured connection between the server and the browser.


EdgeOptions e = new EdgeOptions();

Code Implementation

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;
public class EdgeBrwserSSL{
   public static void main(String[] args) {
      //instance of EdgeOptions
      EdgeOptions e = new EdgeOptions();
      //configure setAcceptInsecureCerts to true boolean value
      //object of EdgeDriver
      WebDriver driver = new EdgeDriver(e);
      //implicit wait
      driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
      //URL launch
      driver.get("application url");

Updated on: 25-Jun-2021


Kickstart Your Career

Get certified by completing the course

Get Started