WebDriverTargetLocator
in
Used to locate a given frame or window.
Table of Contents
Constants
- WINDOW_TYPE_TAB = 'tab'
- WINDOW_TYPE_WINDOW = 'window'
Methods
- activeElement() : WebDriverElement
- Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected.
- alert() : WebDriverAlert
- Switch to the currently active modal dialog for this particular driver instance.
- defaultContent() : WebDriver
- Set the current browsing context to the current top-level browsing context.
- frame() : WebDriver
- Switch to the iframe by its id or name.
- window() : WebDriver
- Switch the focus to another window by its handle.
Constants
WINDOW_TYPE_TAB
public
string
WINDOW_TYPE_TAB
= 'tab'
WINDOW_TYPE_WINDOW
public
string
WINDOW_TYPE_WINDOW
= 'window'
Methods
activeElement()
Switches to the element that currently has focus within the document currently "switched to", or the body element if this cannot be detected.
public
activeElement() : WebDriverElement
Return values
WebDriverElementalert()
Switch to the currently active modal dialog for this particular driver instance.
public
alert() : WebDriverAlert
Return values
WebDriverAlertdefaultContent()
Set the current browsing context to the current top-level browsing context.
public
defaultContent() : WebDriver
This is the same as calling RemoteTargetLocator::frame(null);
Return values
WebDriver —The driver focused on the top window or the first frame.
frame()
Switch to the iframe by its id or name.
public
frame(WebDriverElement|null|int|string $frame) : WebDriver
Parameters
- $frame : WebDriverElement|null|int|string
-
The WebDriverElement, the id or the name of the frame. When null, switch to the current top-level browsing context When int, switch to the WindowProxy identified by the value. When an Element, switch to that Element.
Tags
Return values
WebDriver —The driver focused on the given frame.
window()
Switch the focus to another window by its handle.
public
window(string $handle) : WebDriver
Parameters
- $handle : string
-
The handle of the window to be focused on.
Tags
Return values
WebDriver —The driver focused on the given window.