- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How does Selenium Webdriver handle the SSL certificate in Safari?
Selenium webdriver is capable of handling SSL certificate in the Safari browser. This is done with the help of the DesiredCapabilities class. We shall create an object of this class. Then apply the setCapability method on it and set the value of property CapabilityType.ACCEPT_SSL_CERTS to true.
The SSL is a protocol developed to have a secure connection between the server and the client browser. It verifies the website authenticity before any further communication with it.
Syntax
DesiredCapabilities pc = DesiredCapabilities.safari(); pc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
Example
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.safari.SafariDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.remote.DesiredCapabilities; public class SSLErrorSafari{ public static void main(String[] args) { //instance of DesiredCapabilities DesiredCapabilities pc = DesiredCapabilities.safari(); //set capability pc.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); //set capability to webdriver WebDriver driver=new SafariDriver(pc); //implicit wait driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); //URL launch driver.get("application url to be entered"); } }
- Related Articles
- How does Selenium Webdriver handle SSL certificate in Firefox?
- How does Selenium Webdriver handle SSL certificate in Chrome?
- How does Selenium Webdriver handle the SSL certificate in Edge?
- How to handle SSL certificate error using Selenium WebDriver?
- What is an SSL certificate and how does it work?
- How to take care of SSL certificate issues in chrome browser in Selenium?
- Does Selenium support Safari browser?
- How to handle frames in Selenium Webdriver in Python?
- How does the Selenium WebDriver work?
- How to handle frame in Selenium WebDriver using java?
- nginx ssl certificate installation in linux
- How to handle windows file upload using Selenium WebDriver?
- How can we handle authentication popup in Selenium WebDriver using Java?
- How to handle authentication popup with Selenium WebDriver using Java?
- How can I handle multiple keyboard keys using Selenium Webdriver?

Advertisements