class RemoteTargetLocator implements WebDriverTargetLocator (View source)

Used to locate a given frame or window for RemoteWebDriver.

Properties

protected ExecuteMethod $executor
protected WebDriver $driver
protected bool $isW3cCompliant

Methods

__construct($executor, $driver, $isW3cCompliant = false)

No description

defaultContent()

Set the current browsing context to the current top-level browsing context.

frame(WebDriverElement|string $frame)

Switch to the iframe by its id or name.

parent()

Switch to the parent iframe.

window(string $handle)

Switch the focus to another window by its handle.

alert()

Switch to the currently active modal dialog for this particular driver instance.

activeElement()

Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected.

Details

__construct($executor, $driver, $isW3cCompliant = false)

No description

Parameters

$executor
$driver
$isW3cCompliant

WebDriver defaultContent()

Set the current browsing context to the current top-level browsing context.

This is the same as calling RemoteTargetLocator::frame(null);

Return Value

WebDriver

The driver focused on the top window or the first frame.

WebDriver frame(WebDriverElement|string $frame)

Switch to the iframe by its id or name.

Parameters

WebDriverElement|string $frame

The WebDriverElement, the id or the name of the frame.

Return Value

WebDriver

The driver focused on the given frame.

Exceptions

InvalidArgumentException

WebDriver parent()

Switch to the parent iframe.

Return Value

WebDriver

The driver focused on the given frame.

WebDriver window(string $handle)

Switch the focus to another window by its handle.

Parameters

string $handle

The handle of the window to be focused on.

Return Value

WebDriver

The driver focused on the given window.

See also

WebDriver::getWindowHandles

WebDriverAlert alert()

Switch to the currently active modal dialog for this particular driver instance.

Return Value

WebDriverAlert

WebDriverElement activeElement()

Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected.

Return Value

WebDriverElement