Package org.openqa.selenium
Interface WebDriverInfo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<WebDriver>
createDriver(Capabilities capabilities)
Creates a new instance of theWebDriver
implementation.Capabilities
getCanonicalCapabilities()
Describes the smallest set ofCapabilities
that could be used to create an instance of thisWebDriver
implementation.java.lang.String
getDisplayName()
int
getMaximumSimultaneousSessions()
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
isAvailable()
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
isSupporting(Capabilities capabilities)
boolean
isSupportingBiDi()
boolean
isSupportingCdp()
-
-
-
Method Detail
-
getDisplayName
java.lang.String getDisplayName()
- Returns:
- A human-readable name that describes the browser.
-
getCanonicalCapabilities
Capabilities getCanonicalCapabilities()
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
isAvailable()
returnstrue
, the returnedCapabilities
can be passed tocreateDriver(Capabilities)
and a session will be created.- Returns:
- The smallest set of
Capabilities
required to create an instance of thisWebDriver
implementation.
-
isSupporting
boolean isSupporting(Capabilities capabilities)
- Returns:
- Whether a call to
createDriver(Capabilities)
would succeed if givencapabilities
.
-
isSupportingCdp
boolean isSupportingCdp()
- Returns:
- Whether the driver has enabled the CDP interface.
-
isSupportingBiDi
boolean isSupportingBiDi()
- Returns:
- Whether the driver has enabled the CDP interface.
-
isAvailable
boolean isAvailable()
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.- Returns:
- Whether or not the prerequisites required for this
WebDriver
are present.
-
getMaximumSimultaneousSessions
int getMaximumSimultaneousSessions()
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.
-
createDriver
java.util.Optional<WebDriver> createDriver(Capabilities capabilities) throws SessionNotCreatedException
Creates a new instance of theWebDriver
implementation. The instance must be killed by sending the "quit" command. If the instance cannot be created becauseisAvailable()
isfalse
, thenOptional.empty()
is returned. Otherwise, an attempt to start the session is made and the result returned.- Throws:
SessionNotCreatedException
-
-