org.openqa.selenium.safari
Class SafariDriver

java.lang.Object
  extended by org.openqa.selenium.remote.RemoteWebDriver
      extended by org.openqa.selenium.safari.SafariDriver
All Implemented Interfaces:
org.openqa.selenium.HasCapabilities, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.internal.FindsByClassName, org.openqa.selenium.internal.FindsByCssSelector, org.openqa.selenium.internal.FindsById, org.openqa.selenium.internal.FindsByLinkText, org.openqa.selenium.internal.FindsByName, org.openqa.selenium.internal.FindsByTagName, org.openqa.selenium.internal.FindsByXPath, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver

public class SafariDriver
extends RemoteWebDriver
implements org.openqa.selenium.TakesScreenshot

A WebDriver implementation that controls Safari using a browser extension (consequently, only Safari 5.1+ is supported). This driver can be configured using the SafariOptions class.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriver
RemoteWebDriver.RemoteTargetLocator, RemoteWebDriver.RemoteWebDriverOptions, RemoteWebDriver.When
 
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
org.openqa.selenium.WebDriver.ImeHandler, org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window
 
Field Summary
static String CLEAN_SESSION_CAPABILITY
          Deprecated. use SafariOptions.setUseCleanSession(boolean) instead.
static String DATA_DIR_CAPABILITY
          Deprecated. use SafariOptions.setDataDir(java.io.File) instead.
static String NO_INSTALL_EXTENSION_CAPABILITY
          Deprecated. use SafariOptions.setSkipExtensionInstallation(boolean) instead.
 
Constructor Summary
SafariDriver()
          Initializes a new SafariDriver} class with default SafariOptions.
SafariDriver(org.openqa.selenium.Capabilities desiredCapabilities)
          Converts the specified DesiredCapabilities to a SafariOptions instance and initializes a new SafariDriver using these options.
SafariDriver(SafariOptions safariOptions)
          Initializes a new SafariDriver using the specified SafariOptions.
 
Method Summary
<X> X
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
           
 void setFileDetector(FileDetector detector)
           
protected  void startClient()
           
protected  void stopClient()
           
 
Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
close, execute, execute, executeAsyncScript, executeScript, findElement, findElement, findElementByClassName, findElementByCssSelector, findElementById, findElementByLinkText, findElementByName, findElementByPartialLinkText, findElementByTagName, findElementByXPath, findElements, findElements, findElementsByClassName, findElementsByCssSelector, findElementsById, findElementsByLinkText, findElementsByName, findElementsByPartialLinkText, findElementsByTagName, findElementsByXPath, get, getCapabilities, getCommandExecutor, getCurrentUrl, getElementConverter, getErrorHandler, getExecuteMethod, getFileDetector, getKeyboard, getMouse, getPageSource, getRemoteStatus, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, quit, setCommandExecutor, setElementConverter, setFoundBy, setLogLevel, setSessionId, startSession, startSession, switchTo, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLEAN_SESSION_CAPABILITY

@Deprecated
public static final String CLEAN_SESSION_CAPABILITY
Deprecated. use SafariOptions.setUseCleanSession(boolean) instead.
A boolean capability that instructs the SafariDriver to delete all existing session data when starting a new session. This includes browser history, cache, cookies, HTML5 local storage, and HTML5 databases.

Warning: Since Safari uses a single profile for the current user, enabling this capability will permanently erase any existing session data.

See Also:
Constant Field Values

DATA_DIR_CAPABILITY

@Deprecated
public static final String DATA_DIR_CAPABILITY
Deprecated. use SafariOptions.setDataDir(java.io.File) instead.
Capability that defines the path to a Safari installations data directory. If omitted, the default installation location for the current platform will be used:

This capability may be set either as a String or File object.

See Also:
Constant Field Values

NO_INSTALL_EXTENSION_CAPABILITY

@Deprecated
public static final String NO_INSTALL_EXTENSION_CAPABILITY
Deprecated. use SafariOptions.setSkipExtensionInstallation(boolean) instead.
Boolean capability that specifies whether to skip installing the SafariDriver extension. When using this capability, a copy of the extension must be pre-installed with Safari or the driver will not function.

See Also:
Constant Field Values
Constructor Detail

SafariDriver

public SafariDriver()
Initializes a new SafariDriver} class with default SafariOptions.


SafariDriver

public SafariDriver(org.openqa.selenium.Capabilities desiredCapabilities)
Converts the specified DesiredCapabilities to a SafariOptions instance and initializes a new SafariDriver using these options.

See Also:
SafariOptions.fromCapabilities(org.openqa.selenium.Capabilities)

SafariDriver

public SafariDriver(SafariOptions safariOptions)
Initializes a new SafariDriver using the specified SafariOptions.

Method Detail

setFileDetector

public void setFileDetector(FileDetector detector)
Overrides:
setFileDetector in class RemoteWebDriver

startClient

protected void startClient()
Overrides:
startClient in class RemoteWebDriver

stopClient

protected void stopClient()
Overrides:
stopClient in class RemoteWebDriver

getScreenshotAs

public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
                  throws org.openqa.selenium.WebDriverException
Specified by:
getScreenshotAs in interface org.openqa.selenium.TakesScreenshot
Throws:
org.openqa.selenium.WebDriverException


Copyright © 2013. All rights reserved.