public class SafariDriver extends RemoteWebDriver
SafariOptions
class.RemoteWebDriver.RemoteTargetLocator, RemoteWebDriver.RemoteWebDriverOptions, RemoteWebDriver.When
WebDriver.ImeHandler, WebDriver.Navigation, WebDriver.Options, WebDriver.TargetLocator, WebDriver.Timeouts, WebDriver.Window
Constructor and Description |
---|
SafariDriver()
Initializes a new SafariDriver} class with default
SafariOptions . |
SafariDriver(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 |
---|---|
<X> X |
getScreenshotAs(OutputType<X> target)
Capture the screenshot and store it in the specified location.
|
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, startSession, startSession, switchTo, toString
public SafariDriver()
SafariOptions
.public SafariDriver(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 driverpublic 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. SubtypesstopClient
in class RemoteWebDriver
public <X> X getScreenshotAs(OutputType<X> target) throws WebDriverException
TakesScreenshot
For WebDriver extending TakesScreenshot, this makes a best effort depending on the browser to return the following in order of preference:
For WebElement extending TakesScreenshot, this makes a best effort depending on the browser to return the following in order of preference: - The entire content of the HTML element - The visisble portion of the HTML element
getScreenshotAs
in interface TakesScreenshot
getScreenshotAs
in class RemoteWebDriver
X
- Return type for getScreenshotAs.target
- target type, @see OutputTypeWebDriverException
- on failure.