public final class Driver
extends java.lang.Object
Global object for initializing and storing WebDriver objects. It provides functionality which defines the WebDriver instance for current thread which can be used for parallel execution.
Modifier and Type | Method and Description |
---|---|
static org.openqa.selenium.WebDriver |
current()
Returns the WebDriver instance for current thread.
|
static java.lang.String |
getThreadName()
Generates string which corresponds to current thream.
|
static org.openqa.selenium.WebDriver |
init(java.lang.String url,
Platform platform,
org.openqa.selenium.Capabilities capabilities)
Initializes WebDriver instance and puts it into internal storage based on URL, platform
and capabilities.
|
static void |
init(org.openqa.selenium.WebDriver driver)
Puts specified WebDriver instance into internal storage.
|
public static java.lang.String getThreadName()
public static void init(org.openqa.selenium.WebDriver driver)
driver
- the WebDriver instance to store.public static org.openqa.selenium.WebDriver init(java.lang.String url, Platform platform, org.openqa.selenium.Capabilities capabilities) throws java.lang.Exception
url
- the remote WebDriver URL. Will be ignored for standard web platforms.platform
- the target platform.capabilities
- the set of capabilities.java.lang.Exception
- any exception which may appear during WebDriver instance initialization.public static org.openqa.selenium.WebDriver current()