Package org.openqa.selenium.safari
Class SafariDriver
java.lang.Object
org.openqa.selenium.remote.RemoteWebDriver
org.openqa.selenium.safari.SafariDriver
- All Implemented Interfaces:
- org.openqa.selenium.federatedcredentialmanagement.HasFederatedCredentialManagement,- org.openqa.selenium.HasCapabilities,- org.openqa.selenium.HasDownloads,- org.openqa.selenium.interactions.Interactive,- org.openqa.selenium.JavascriptExecutor,- org.openqa.selenium.PrintsPage,- HasDebugger,- HasPermissions,- org.openqa.selenium.SearchContext,- org.openqa.selenium.TakesScreenshot,- org.openqa.selenium.virtualauthenticator.HasVirtualAuthenticator,- org.openqa.selenium.WebDriver
public class SafariDriver
extends org.openqa.selenium.remote.RemoteWebDriver
implements HasPermissions, HasDebugger
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 SummaryNested classes/interfaces inherited from class org.openqa.selenium.remote.RemoteWebDriverorg.openqa.selenium.remote.RemoteWebDriver.RemoteTargetLocator, org.openqa.selenium.remote.RemoteWebDriver.RemoteWebDriverOptions, org.openqa.selenium.remote.RemoteWebDriver.WhenNested classes/interfaces inherited from interface org.openqa.selenium.WebDriverorg.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 SummaryFields inherited from class org.openqa.selenium.remote.RemoteWebDrivercapabilities
- 
Constructor SummaryConstructorsConstructorDescriptionInitializes a new SafariDriver} class with defaultSafariOptions.SafariDriver(org.openqa.selenium.remote.service.DriverService service, SafariOptions options) Initializes a new SafariDriver using the specifiedSafariOptions.SafariDriver(org.openqa.selenium.remote.service.DriverService service, SafariOptions options, org.openqa.selenium.remote.http.ClientConfig clientConfig) SafariDriver(SafariDriverService safariService) Initializes a new SafariDriver backed by the specifiedSafariDriverService.SafariDriver(SafariOptions safariOptions) Initializes a new SafariDriver using the specifiedSafariOptions.
- 
Method SummaryModifier 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 org.openqa.selenium.remote.RemoteWebDriverBuilderbuilder()voidsetFileDetector(org.openqa.selenium.remote.FileDetector detector) voidsetPermissions(String permission, boolean value) Set permission on the browser.Methods inherited from class org.openqa.selenium.remote.RemoteWebDriveraddVirtualAuthenticator, 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, isDownloadsEnabled, 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openqa.selenium.HasDownloadsrequireDownloadsEnabledMethods inherited from interface org.openqa.selenium.JavascriptExecutorexecuteScript, getPinnedScripts, pin, unpin
- 
Constructor Details- 
SafariDriverpublic SafariDriver()Initializes a new SafariDriver} class with defaultSafariOptions.
- 
SafariDriverInitializes a new SafariDriver using the specifiedSafariOptions.- Parameters:
- safariOptions- safari specific options / capabilities for the driver
 
- 
SafariDriverInitializes a new SafariDriver backed by the specifiedSafariDriverService.- Parameters:
- safariService- preconfigured safari service
 
- 
SafariDriverpublic SafariDriver(org.openqa.selenium.remote.service.DriverService service, SafariOptions options) Initializes a new SafariDriver using the specifiedSafariOptions.- Parameters:
- service- either- SafariTechPreviewDriverServiceor- SafariDriverService
- options- safari specific options / capabilities for the driver
 
- 
SafariDriverpublic SafariDriver(org.openqa.selenium.remote.service.DriverService service, SafariOptions options, org.openqa.selenium.remote.http.ClientConfig clientConfig) 
 
- 
- 
Method Details- 
builder@Beta public static org.openqa.selenium.remote.RemoteWebDriverBuilder builder()
- 
setPermissionsDescription copied from interface:HasPermissionsSet permission on the browser. The only supported permission at this time is "getUserMedia".- Specified by:
- setPermissionsin interface- HasPermissions
- Parameters:
- permission- the name of the item to set permission on.
- value- whether the permission has been granted.
 
- 
getPermissions- Specified by:
- getPermissionsin interface- HasPermissions
- Returns:
- each permission and whether it is allowed or not.
 
- 
attachDebuggerpublic 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 interface- HasDebugger
 
- 
setFileDetectorpublic void setFileDetector(org.openqa.selenium.remote.FileDetector detector) - Overrides:
- setFileDetectorin class- org.openqa.selenium.remote.RemoteWebDriver
 
 
-