
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Does Selenium Support Safari Browser?
Yes Selenium webdriver supports Safari browser. Safari is a prominent browser and is provided by default by Apple devices. For Safari versions 10 and greater than 10, the safaridriver comes automatically and is not required to be installed separately.
The location of the SafariDriver is: /usr/bin/safaridriver. Also, it must be remembered that to work with the Safari latest version, users should have the Apple machine. This is because the Apply no longer supports Safari on Windows (from 2012).
If we are using an older version of Safari in the Apple machine, we have to turn on the webdriver support, by running the command −
/usr/bin/safaridriver −−enable
First, we have to navigate to Safari, then click on Preferences. Choose the option Advanced and check the checkbox Show Develop menu in menu bar.
Then, from the Develop menu, turn on the Allow Remote Automation option.
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; public class LaunchSafariBrw{ public static void main(String[] args) { //object of SafariDriver WebDriver driver = new SafariDriver(); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); //launch browser driver.get("https://www.tutorialspoint.com/index.htm"); // close browser driver.close(); } }