.frame() Suggest edits
Change focus to another frame on the page.
Changes the focus of all future commands to another frame on the page. The
target frame may be specified as one of the following:
- A number that specifies a (zero-based) index into window.frames
- An element (css selector) which correspond to a
frameoriframe
DOM element - The
nullvalue, to select the topmost frame on the page.
If the specified frame can not be found, a NoSuchFrameError will be thrown
Usage
Example
this.demoTest = function (browser) {
browser.frame('<ID>', function(result) {
console.log(result);
});
}
Parameters
| Name | Type | description |
|---|---|---|
frameIdOptional |
string | number | null | Identifier for the frame to change focus to. |
callbackOptional |
function | Optional callback function to be called when the command finishes. |