Handling untrusted SSL certificates in different browsers using Selenium?

0 votes
Jun 3 in Selenium by Ishita
20 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Hi Ishita, you can handle untrusted SSL certificates in different browsers by using these code snippets:

  1. In Chrome Browser:

    •  // Create object of DesiredCapabilities class
      DesiredCapabilities cap=DesiredCapabilities.chrome();
      
      // Set ACCEPT_SSL_CERTS  variable to true
      cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
      
      // Set the driver path
      System.setProperty("webdriver.chrome.driver","Chrome driver path");
      
      // Open browser with capability
      WebDriver driver=new ChromeDriver(cap);
  2. In Internet Explorer:

    • // Create object of DesiredCapabilities class
      
      DesiredCapabilities cap=DesiredCapabilities.internetExplorer();
      
      // Set ACCEPT_SSL_CERTS  variable to true
      cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
      
      // Set the driver path
      System.setProperty("webdriver.ie.driver","IE driver path");
      
      // Open browser with capability
      WebDriver driver=newInternetExplorerDriver(cap);
  3. In Safari:

    • // Create object of DesiredCapabilities class
      
      DesiredCapabilities cap=DesiredCapabilities.safari();
      
      // Set ACCEPT_SSL_CERTS  variable to true
      cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
      
      // Set the driver path
      System.setProperty("webdriver.safari.driver","Safari driver path");
      
      // Open browser with capability
      WebDriver driver=new SafariDriver(cap);
answered Jun 3 by Abha
• 8,330 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Handling pop up in Chrome using Selenium WebDriver

AutoIt Window Information Tool do not recognize ...READ MORE

answered Jun 11, 2018 in Selenium by Meci Matt
• 9,400 points
484 views
0 votes
1 answer
0 votes
1 answer

How can we take screenshots of tests in Selenium 2 using C#

We can take screenshots using below function ...READ MORE

answered Mar 23, 2018 in Selenium by nsv999
• 5,050 points
115 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
135 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
527 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
129 views
0 votes
1 answer
0 votes
1 answer

What are locators in Selenium and what are the different types of it?

Hi Divya, in Selenium Locators define an ...READ MORE

answered May 7 in Selenium by Abha
• 8,330 points
37 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.