Handling SSL Certificates Errors with Selenium WebDriver

Below are some of the sample SSL Certificate errors
  1. Firefox
chromessl

2. IE
for_different_site
3. Chrome
ssl-errorchrome

How do we bypass these pages through selenium webdriver.
Its handled using the DesiredCapabilities class and setting up the Capability for handling SSL Error as below.
DesiredCapabilities capability = DesiredCapabilities.chrome(); // To Accept SSL certificate capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Then later pass the ‘capability’ object to the driver constructors as below.
  1. Firefox :
FirefoxDriver driver =new FirefoxDriver(capability);
2. Chrome :
System.setProperty(“webdriver.chrome.driver”“E:/chromedriver.exe”);
ChromeDriver driver = new ChromeDriver(capability);
3. IE :
System.setProperty(“webdriver.ie.driver”“E:/IEDriverServer.exe”);
InternetExplorerDriver driver = new InternetExplorerDriver(capability);

Comments

  1. Hello Shama,
    The Article on Handling SSL Certificates Errors with Selenium WebDriver is nice give detail information about it.Thanks for Sharing the information about SSL Certificates. Software Testing Services

    ReplyDelete
  2. Really good information to show through this blog. I really appreciate you for all the valuable information that you are providing us through your blog.

    Pen testing services
    Vulnerability assessment services
    Load Testing Services
    Mobile app testing services

    ReplyDelete

Post a Comment

Popular posts from this blog

Cross Browser testing for React Apps

Fixing the appium installation with NPM

Challenges in testing ChatBots