Package org.openqa.selenium.safari
Class SafariTechPreviewDriverInfo
java.lang.Object
org.openqa.selenium.safari.SafariTechPreviewDriverInfo
- All Implemented Interfaces:
WebDriverInfo
@AutoService(WebDriverInfo.class)
public class SafariTechPreviewDriverInfo
extends Object
implements WebDriverInfo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateDriver
(Capabilities capabilities) Creates a new instance of theWebDriver
implementation.Describes the smallest set ofCapabilities
that could be used to create an instance of thisWebDriver
implementation.int
Some browsers require all the resources of the current system in order to run (for example, Safari on iOS) and so do not support multiple simultaneous sessions on the same system.boolean
Often, aWebDriver
instance needs one or more supporting files or executables to be present (such as a vendor-provided executable which speaks the WebDriver Protocol).boolean
Checks whether the browser driver is already present on the host machine.boolean
isSupporting
(Capabilities capabilities) boolean
boolean
-
Constructor Details
-
SafariTechPreviewDriverInfo
public SafariTechPreviewDriverInfo()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayName
in interfaceWebDriverInfo
- Returns:
- A human-readable name that describes the browser.
-
getCanonicalCapabilities
Description copied from interface:WebDriverInfo
Describes the smallest set ofCapabilities
that could be used to create an instance of thisWebDriver
implementation.Note, this set does not need to be exhaustive: the only requirement is that if
WebDriverInfo.isAvailable()
returnstrue
, the returnedCapabilities
can be passed toWebDriverInfo.createDriver(Capabilities)
and a session will be created.- Specified by:
getCanonicalCapabilities
in interfaceWebDriverInfo
- Returns:
- The smallest set of
Capabilities
required to create an instance of thisWebDriver
implementation.
-
isSupporting
- Specified by:
isSupporting
in interfaceWebDriverInfo
- Returns:
- Whether a call to
WebDriverInfo.createDriver(Capabilities)
would succeed if givencapabilities
.
-
isSupportingCdp
public boolean isSupportingCdp()- Specified by:
isSupportingCdp
in interfaceWebDriverInfo
- Returns:
- Whether the driver has enabled the CDP interface.
-
isSupportingBiDi
public boolean isSupportingBiDi()- Specified by:
isSupportingBiDi
in interfaceWebDriverInfo
- Returns:
- Whether the driver has enabled the BiDi interface.
-
isAvailable
public boolean isAvailable()Description copied from interface:WebDriverInfo
Often, aWebDriver
instance needs one or more supporting files or executables to be present (such as a vendor-provided executable which speaks the WebDriver Protocol). This means that even though the driver classes might be present in Java, it would make no sense to attempt to instantiate the driver itself.- Specified by:
isAvailable
in interfaceWebDriverInfo
- Returns:
- Whether the prerequisites required for this
WebDriver
are present.
-
isPresent
public boolean isPresent()Description copied from interface:WebDriverInfo
Checks whether the browser driver is already present on the host machine. Different fromWebDriverInfo.isAvailable()
which uses Selenium Manager to obtain the driver when not present.- Specified by:
isPresent
in interfaceWebDriverInfo
- Returns:
- Whether the browser driver is present on the host machine.
-
getMaximumSimultaneousSessions
public int getMaximumSimultaneousSessions()Description copied from interface:WebDriverInfo
Some browsers require all the resources of the current system in order to run (for example, Safari on iOS) and so do not support multiple simultaneous sessions on the same system. Other browsers can create isolated state for each newWebDriver
instance.The count of simultaneous sessions is typically 1, some multiple of the available number of cores, or
Integer.MAX_VALUE
if the number is unbounded or no-one cares.- Specified by:
getMaximumSimultaneousSessions
in interfaceWebDriverInfo
-
createDriver
public Optional<WebDriver> createDriver(Capabilities capabilities) throws SessionNotCreatedException Description copied from interface:WebDriverInfo
Creates a new instance of theWebDriver
implementation. The instance must be killed by sending the "quit" command. If the instance cannot be created becauseWebDriverInfo.isAvailable()
isfalse
, thenOptional.empty()
is returned. Otherwise, an attempt to start the session is made and the result returned.- Specified by:
createDriver
in interfaceWebDriverInfo
- Throws:
SessionNotCreatedException
-