public class SafariDriver extends RemoteWebDriver
SafariOptions
class.RemoteWebDriver.RemoteTargetLocator, RemoteWebDriver.RemoteWebDriverOptions, RemoteWebDriver.When
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
Modifier and Type | Field and Description |
---|---|
private SafariDriverService |
service |
static java.lang.String |
USE_LEGACY_DRIVER_CAPABILITY
Capability to force usage of the deprecated SafariDriver extension while running
on macOS Sierra.
|
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
private static CommandExecutor |
getExecutor(SafariOptions options) |
<X> X |
getScreenshotAs(org.openqa.selenium.OutputType<X> target) |
void |
setFileDetector(FileDetector detector)
Set the file detector to be used when sending keyboard input.
|
protected void |
startClient()
Method called before
starting a new session . |
protected void |
stopClient()
Method called after executing a
RemoteWebDriver.quit() command. |
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, getSessionId, getTitle, getW3CStandardComplianceLevel, getWindowHandle, getWindowHandles, log, manage, navigate, quit, setCommandExecutor, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startClient, startSession, startSession, stopClient, switchTo, toString
public static final java.lang.String USE_LEGACY_DRIVER_CAPABILITY
DesiredCapabilities safariCap = DesiredCapabilities.Safari(); safariCap.setCapability(SafariDriver.USE_LEGACY_DRIVER_CAPABILITY, true); WebDriver driver = new SafariDriver(safariCap);
private SafariDriverService service
public SafariDriver()
SafariOptions
.public SafariDriver(org.openqa.selenium.Capabilities desiredCapabilities)
DesiredCapabilities
to a SafariOptions
instance and initializes a new SafariDriver using these options.desiredCapabilities
- capabilities requested of the driverSafariOptions.fromCapabilities(org.openqa.selenium.Capabilities)
public SafariDriver(SafariOptions safariOptions)
SafariOptions
.safariOptions
- safari specific options / capabilities for the driverprivate static CommandExecutor getExecutor(SafariOptions options)
public void setFileDetector(FileDetector detector)
RemoteWebDriver
setFileDetector
in class RemoteWebDriver
detector
- The detector to use. Must not be null.FileDetector
,
LocalFileDetector
,
UselessFileDetector
protected void startClient()
RemoteWebDriver
starting a new session
. The default
implementation is a no-op, but subtypes should override this method to define custom behavior.startClient
in class RemoteWebDriver
protected void stopClient()
RemoteWebDriver
RemoteWebDriver.quit()
command. The default implementation is a no-op,
but subtypes should override this method to define custom behavior.stopClient
in class RemoteWebDriver
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException
getScreenshotAs
in interface org.openqa.selenium.TakesScreenshot
getScreenshotAs
in class RemoteWebDriver
org.openqa.selenium.WebDriverException