frame

Change focus to another frame on the page. If the frame id is null, the server should switch to the page’s default content.

Usage

1
browser.frame(id);

Parameters

Param Type Details
id String/Number/null/WebElementJSONObject Identifier for the frame to change focus to.

Example

frame.js
1
2
3
4
5
6
it('should switch focus to iFrame', function () {
// Using `element` to find an iframe and providing it to `frame` method
browser.waitForExist('iframe[name="my_iframe"]');
var my_frame = $('iframe[name="my_iframe"]').value;
browser.frame(my_frame);
});