Package org.openqa.selenium.safari
Class SafariDriver
java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.safari.SafariDriver
- All Implemented Interfaces:
HasFederatedCredentialManagement,HasCapabilities,HasDownloads,Interactive,JavascriptExecutor,PrintsPage,HasDebugger,HasPermissions,SearchContext,TakesScreenshot,HasVirtualAuthenticator,WebDriver
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.WhenNested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
WebDriver.Navigation, WebDriver.Options, WebDriver.TargetLocator, WebDriver.Timeouts, WebDriver.Window -
Field Summary
Fields inherited from class org.openqa.selenium.remote.RemoteWebDriver
capabilities -
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new SafariDriver} class with defaultSafariOptions.SafariDriver(DriverService service, SafariOptions options) Initializes a new SafariDriver using the specifiedSafariOptions.SafariDriver(DriverService service, SafariOptions options, ClientConfig clientConfig) SafariDriver(SafariDriverService safariService) Initializes a new SafariDriver backed by the specifiedSafariDriverService.SafariDriver(SafariOptions safariOptions) Initializes a new SafariDriver using the specifiedSafariOptions. -
Method Summary
Modifier and TypeMethodDescriptionvoidThis opens Safari's Web Inspector If driver subsequently executes script of "debugger;" the execution will pause, no additional commands will be processed, and the code will time out.static RemoteWebDriverBuilderbuilder()voidsetFileDetector(FileDetector detector) Set the file detector to be used when sending keyboard input.voidsetPermissions(String permission, boolean value) Set permission on the browser.Methods inherited from class org.openqa.selenium.remote.RemoteWebDriver
addVirtualAuthenticator, close, deleteDownloadableFiles, downloadFile, execute, execute, execute, executeAsyncScript, executeScript, findElement, findElements, findElements, get, getCapabilities, getCommandExecutor, getCurrentUrl, getDownloadableFiles, getElementConverter, getErrorHandler, getExecuteMethod, getFederatedCredentialManagementDialog, getFileDetector, getPageSource, getScreenshotAs, getSessionId, getTitle, getWindowHandle, getWindowHandles, log, manage, navigate, network, perform, print, quit, removeVirtualAuthenticator, resetCooldown, resetInputState, script, setCommandExecutor, setDelayEnabled, setElementConverter, setErrorHandler, setFoundBy, setLogLevel, setSessionId, startSession, switchTo, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openqa.selenium.HasDownloads
requireDownloadsEnabledMethods inherited from interface org.openqa.selenium.JavascriptExecutor
executeScript, getPinnedScripts, pin, unpin
-
Constructor Details
-
SafariDriver
public SafariDriver()Initializes a new SafariDriver} class with defaultSafariOptions. -
SafariDriver
Initializes a new SafariDriver using the specifiedSafariOptions.- Parameters:
safariOptions- safari specific options / capabilities for the driver
-
SafariDriver
Initializes a new SafariDriver backed by the specifiedSafariDriverService.- Parameters:
safariService- preconfigured safari service
-
SafariDriver
Initializes a new SafariDriver using the specifiedSafariOptions.- Parameters:
service- eitherSafariTechPreviewDriverServiceorSafariDriverServiceoptions- safari specific options / capabilities for the driver
-
SafariDriver
-
-
Method Details
-
builder
-
setPermissions
Description copied from interface:HasPermissionsSet permission on the browser. The only supported permission at this time is "getUserMedia".- Specified by:
setPermissionsin interfaceHasPermissions- Parameters:
permission- the name of the item to set permission on.value- whether the permission has been granted.
-
getPermissions
- Specified by:
getPermissionsin interfaceHasPermissions- Returns:
- each permission and whether it is allowed or not.
-
attachDebugger
public void attachDebugger()Description copied from interface:HasDebuggerThis opens Safari's Web Inspector If driver subsequently executes script of "debugger;" the execution will pause, no additional commands will be processed, and the code will time out.- Specified by:
attachDebuggerin interfaceHasDebugger
-
setFileDetector
Description copied from class:RemoteWebDriverSet the file detector to be used when sending keyboard input. By default, this is set to a file detector that does nothing.- Overrides:
setFileDetectorin classRemoteWebDriver- Parameters:
detector- The detector to use. Must not be null.- See Also:
-