public final class LocalWebDriverFactory extends Object implements WebDriverFactory
WebDriverFactory
that creates local WebDriver
instances.Constructor and Description |
---|
LocalWebDriverFactory()
Create a
LocalWebDriverFactory without BinaryManager . |
LocalWebDriverFactory(BinaryManager binaryManager)
Create a
LocalWebDriverFactory that is able to download binaries if necessary. |
LocalWebDriverFactory(BinaryManager binaryManager,
WebDriverFactoryConfig config)
Create a
LocalWebDriverFactory that is able to download binaries if necessary. |
Modifier and Type | Method and Description |
---|---|
org.openqa.selenium.WebDriver |
createWebDriver(org.openqa.selenium.Capabilities capabilities)
Get a
WebDriver instance based on the given Capabilities . |
public LocalWebDriverFactory(@Nullable BinaryManager binaryManager, WebDriverFactoryConfig config)
LocalWebDriverFactory
that is able to download binaries if necessary.binaryManager
- The BinaryManager
to use for downloading binariesconfig
- The WebDriverFactoryConfig
to usepublic LocalWebDriverFactory(@Nullable BinaryManager binaryManager)
LocalWebDriverFactory
that is able to download binaries if necessary.binaryManager
- The BinaryManager
to use for downloading binariespublic LocalWebDriverFactory()
LocalWebDriverFactory
without BinaryManager
.
Note that the resulting LocalWebDriverFactory
instance will not be
able to download any binaries, so you might only be able to create instances
of WebDriver
for browsers that do not require a separate binary.
@Nonnull public org.openqa.selenium.WebDriver createWebDriver(org.openqa.selenium.Capabilities capabilities)
WebDriver
instance based on the given Capabilities
.
Per default, LocalWebDriverFactory
will always attempt to download
the latest version of a binary when necessary. This behavior can be altered
by providing a WebDriverFactoryConfig
at construction which specifies
a specific version on a per-browser basis.
Note that Capabilities.getPlatform()
will be ignored.
Instead, the current operating system and architecture will be detected
and a matching binary will be downloaded (if possible and / or necessary).
createWebDriver
in interface WebDriverFactory
capabilities
- The desired capabilitiesWebDriver
instanceWebDriverFactoryException
- When creating the WebDriver
instance failedIllegalArgumentException
- When the given Capabilities
do not specify a browser nameLocalWebDriverFactory(BinaryManager)
,
LocalWebDriverFactory(BinaryManager, WebDriverFactoryConfig)
Copyright © 2019. All rights reserved.