How to Launch Apple Safari browser?

How to Launch Apple Safari browser?

Apple Safari

SafariDriver comes bundled with the Selenium server’s package, thus user is not required to download or set any external entity. It is readily available to execute the test scripts on Safari. Thus, user can directly launch the Safari Browser similar to that of Mozilla Firefox.


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.safari.SafariDriver;
public class SafariDriverTest {

   public static void main(String[] args) {

       // Create webDriver reference
       WebDriver driver;
       // Launch SafariDriver
       driver = new SafariDriver();
       // Open the web page
       // Enter the text in the search box
       WebElement searchText = driver.findElement("q"));
       // Close the driver


103total visits,1visits today

Leave a Reply

Your email address will not be published. Required fields are marked *