public interface WebDriverProvider
Interface for using custom WebDriver in your tests
To customize WebDriver creation one can use any of the alternatives:
com.codeborne.selenide.WebDriverRunner#setWebDriver(WebDriver) explicitly.
WebDriver implementation, override public XxxDriver(Capabilities desiredCapabilities)
constructor and pass this class name as browser system variable value.
browser system variable value.
| Modifier and Type | Method and Description |
|---|---|
org.openqa.selenium.WebDriver |
createDriver(org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
Create new
WebDriver instance. |
@CheckReturnValue
@Nonnull
org.openqa.selenium.WebDriver createDriver(@Nonnull
org.openqa.selenium.remote.DesiredCapabilities desiredCapabilities)
WebDriver instance. The instance will be bound to current thread, so there is no need to cache
this instance in method implementation. Also don't cache the instance in static variable, as WebDriver
instance is not thread-safe.desiredCapabilities - set of desired capabilities as suggested by Selenide framework; method implementation is
recommended to pass this variable to WebDriver, probably modifying it according to specific needsWebDriver instance