Monday, 28 May 2012

Using Safari Webdriver

Hi all:
Recently the selenium team has released the safaridriver extension than allows the communication between WebDriver and the browser.
However, this extension is only available for Safari 5+ and you need  tune up you browser before you can install it. In addition, you need to compile the extension from the sources.
Here are all the steps with a few screenshots to help you in all the process.
I hope these steps be useful


Installation steps

Safari Extension:
If you dont want to compile the extension, or if you have problems when compiling, you can use download a precompiled extension from here (look for the file)

  1. Checkout the 16670 version of the selenium project. Download all the project, not just the safariDriver folder. ~150Mb
  2. Build the extension. You need java properly set in your system's settings.


  1. Register as an Apple Developer in
  2. Join in the Safari development program
  3. Generate a Safari certificate
  4. Install the certificate
  5. Open Safari.
  6. In Safari, go to Preferences -> Advanced -> check the Show Development menu in menu bar.
  7. Go to develop -> show extension builder.
  8. Click on + (Add) -> Add extension
  9. Select the SafariDriver.safariExtension folder, located in 
  10. Click on install


   * Sets safari driver
   * @param context
   *          Current test context
  private void setSafariDriver()
      getLogger().log(Level.INFO, "Starting safari");
      if (isSupportedPlatform())
          driver = new SafariDriver();
          getLogger().log(Level.INFO, "Safari started correctly");
          getLogger().log(Level.INFO, "Platform not valid.");
  private static boolean isSupportedPlatform()
      Platform current = Platform.getCurrent();
      return ||;


You can try with a JUnit class
In example:

    public void StartSafariWD() {

No comments:

Post a Comment

Esquivando la subscricion en

Cansado de recibir la imagen de la subscripción digital a LaVoz? La solución es muy fácil! Solamente desactivar Javascript para el si...