Safari Driver
With Selenium 3.0 and WebDriver becoming the W3C standard, Apple now provides SafariDriver built into the browser. We do not have to download it separately. However, in order to work it with Selenium WebDriver, we have to set a Develop | Allow Remote Automation
option from Safari's main menu, as shown in the following screenshot:

Allowing remote automation
Writing your first test script for the Safari browser
This is as straight forward. The following is the test script using the Safari Driver:
public class SearchTest { WebDriver driver; @BeforeMethod public void setup() { driver = new SafariDriver(); driver.get("http://demo-store.seleniumacademy.com/"); } @Test public void searchProduct() { // find search box and enter search string WebElement searchBox = driver.findElement(By.name("q")); searchBox.sendKeys("Phones"); WebElement searchButton = driver.findElement(By.className("search-button")); searchButton.click(); assertThat(driver.getTitle()) .isEqualTo...