RemoteWebDriver
class RemoteWebDriver implements WebDriver, JavaScriptExecutor (View source)
Properties
protected HttpCommandExecutor | $executor | ||
protected string | $sessionID | ||
protected RemoteMouse | $mouse | ||
protected RemoteKeyboard | $keyboard | ||
protected RemoteTouchScreen | $touch | ||
protected RemoteExecuteMethod | $executeMethod |
Methods
No description
Construct the RemoteWebDriver by a desired capabilities.
[Experimental] Construct the RemoteWebDriver by an existing session.
Find all WebDriverElements within the current page using the given mechanism.
Get a string representing the current URL that the browser is looking at.
Get the source of the last loaded page.
Get the title of the current page.
Return an opaque handle to this window that uniquely identifies it within this driver instance.
Get all window handles available to the current session.
Quits this driver, closing every associated window.
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.
Inject a snippet of JavaScript into the page for asynchronous execution in the context of the currently selected frame.
Take a screenshot of the current page.
Construct a new WebDriverWait by the current WebDriver instance.
An abstraction for managing stuff you would do in a browser menu. For example, adding and deleting cookies.
An abstraction allowing the driver to access the browser's history and to navigate to a given URL.
Switch to a different window or frame.
No description
No description
No description
No description
Construct a new action builder.
Return the WebDriverElement with the given id.
Set the command executor of this RemoteWebdriver
Set the command executor of this RemoteWebdriver
Set the session id of the RemoteWebDriver.
Get current selenium sessionID
Get all selenium sessions.
No description
Details
protected
__construct()
No description
static RemoteWebDriver
create(string $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)
Construct the RemoteWebDriver by a desired capabilities.
static RemoteWebDriver
createBySessionID(string $session_id, string $url = 'http://localhost:4444/wd/hub')
[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 do not have to pass the desired capabilities because the session was created before.
WebDriver
close()
Close the current window.
WebDriverElement
findElement(WebDriverBy $by)
Find the first WebDriverElement using the given mechanism.
WebDriverElement[]
findElements(WebDriverBy $by)
Find all WebDriverElements within the current page using the given mechanism.
WebDriver
get(string $url)
Load a new web page in the current browser window.
string
getCurrentURL()
Get a string representing the current URL that the browser is looking at.
string
getPageSource()
Get the source of the last loaded page.
string
getTitle()
Get the title of the current page.
string
getWindowHandle()
Return an opaque handle to this window that uniquely identifies it within this driver instance.
array
getWindowHandles()
Get all window handles available to the current session.
quit()
Quits this driver, closing every associated window.
mixed
executeScript(string $script, array $arguments = array())
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.
mixed
executeAsyncScript(string $script, array $arguments = array())
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.
string
takeScreenshot(string $save_as = null)
Take a screenshot of the current page.
WebDriverWait
wait(int $timeout_in_second = 30, int $interval_in_millisecond = 250)
Construct a new WebDriverWait by the current WebDriver instance.
Sample usage:
$driver->wait(20, 1000)->until( WebDriverExpectedCondition::titleIs('WebDriver Page') );
WebDriverOptions
manage()
An abstraction for managing stuff you would do in a browser menu. For example, adding and deleting cookies.
WebDriverNavigation
navigate()
An abstraction allowing the driver to access the browser's history and to navigate to a given URL.
WebDriverTargetLocator
switchTo()
Switch to a different window or frame.
RemoteMouse
getMouse()
No description
RemoteKeyboard
getKeyboard()
No description
RemoteTouchScreen
getTouch()
No description
protected
getExecuteMethod()
No description
WebDriverActions
action()
Construct a new action builder.
protected RemoteWebElement
newElement(string $id)
Return the WebDriverElement with the given id.
RemoteWebDriver
setCommandExecutor(WebDriverCommandExecutor $executor)
Set the command executor of this RemoteWebdriver
HttpCommandExecutor
getCommandExecutor()
Set the command executor of this RemoteWebdriver
RemoteWebDriver
setSessionID(string $session_id)
Set the session id of the RemoteWebDriver.
string
getSessionID()
Get current selenium sessionID
static array
getAllSessions(string $url = 'http://localhost:4444/wd/hub', int $timeout_in_ms = 30000)
Get all selenium sessions.
mixed
execute($command_name, array $params = array())
No description