__construct
(
HttpCommandExecutor
$commandExecutor, $sessionId,
WebDriverCapabilities
$capabilities = null)
No description
create
(string $selenium_server_url = 'http://localhost:4444/wd/hub',
DesiredCapabilities
|array $desired_capabilities = null, int|null $connection_timeout_in_ms = null, int|null $request_timeout_in_ms = null, string|null $http_proxy = null, int|null $http_proxy_port = null,
DesiredCapabilities
$required_capabilities = null)
Construct the RemoteWebDriver by a desired capabilities.
castToDesiredCapabilitiesObject
(array|
DesiredCapabilities
|null $desired_capabilities = null)
Cast legacy types (array or null) to DesiredCapabilities object. To be removed in future when instance of
DesiredCapabilities will be required.
createBySessionID
(string $session_id, string $selenium_server_url = 'http://localhost:4444/wd/hub')
[Experimental] Construct the RemoteWebDriver by an existing session.
executeScript
(string $script, array $arguments = [])
Inject a snippet of JavaScript into the page for execution in the context
of the currently selected frame. The executed script is assumed to be
synchronous and the result of evaluating the script will be returned.
executeAsyncScript
(string $script, array $arguments = [])
Inject a snippet of JavaScript into the page for asynchronous execution in
the context of the currently selected frame.
getAllSessions
(string $selenium_server_url = 'http://localhost:4444/wd/hub', int $timeout_in_ms = 30000)
Returns a list of the currently active sessions.
static
RemoteWebDriver
create
(string $selenium_server_url = 'http://localhost:4444/wd/hub',
DesiredCapabilities
|array $desired_capabilities = null, int|null $connection_timeout_in_ms = null, int|null $request_timeout_in_ms = null, string|null $http_proxy = null, int|null $http_proxy_port = null,
DesiredCapabilities
$required_capabilities = null)
int|null
$connection_timeout_in_ms
Set timeout for the connect phase to remote Selenium WebDriver server
int|null
$request_timeout_in_ms
Set the maximum time of a request to remote Selenium WebDriver server
string|null
$http_proxy
The proxy to tunnel requests to the remote Selenium WebDriver through
int|null
$http_proxy_port
The proxy port to tunnel requests to the remote Selenium WebDriver through
DesiredCapabilities
$required_capabilities
The required capabilities
Cast legacy types (array or null) to DesiredCapabilities object. To be removed in future when instance of
DesiredCapabilities will be required.
Parameters
array|
DesiredCapabilities
|null
$desired_capabilities
[Experimental] Construct the RemoteWebDriver by an existing session.
This constructor can boost the performance a lot by reusing the same browser for the whole test suite.
You cannot the desired capabilities because the session was created before.
Parameters
string
$session_id
The existing session id
string
$selenium_server_url
The url of the remote Selenium WebDriver server
Inject a snippet of JavaScript into the page for execution in the context
of the currently selected frame. The executed script is assumed to be
synchronous and the result of evaluating the script will be returned.
Parameters
string
$script
The script to inject.
array
$arguments
The arguments of the script.
Inject a snippet of JavaScript into the page for asynchronous execution in
the context of the currently selected frame.
The driver will pass a callback as the last argument to the snippet, and
block until the callback is invoked.
Parameters
string
$script
The script to inject.
array
$arguments
The arguments of the script.
Construct a new WebDriverWait by the current WebDriver instance.
Sample usage:
$driver->wait(20, 1000)->until(
WebDriverExpectedCondition::titleIs('WebDriver Page')
Parameters
$timeout_in_second
$interval_in_millisecond