The information in this topic may be out of date. The current SDK reference guide has moved here.

frame method

Class: TargetPlatform: Selenium 4Language: JavaScript SDK:

Configure check to match an iframe in a window or another iframe.

Chain several calls to this method to navigate a hierarchical iframe tree. You can also chain a region method to define that only a region in the frame should be matched and not the entire iframe.

Syntax

eyes.check(Target.frame(context));
eyes.check(Target.frame(frame_ele, scrollRootElement_ele));
eyes.check(Target.frame(frame_ele));
eyes.check(Target.frame(frame_ele, scrollRootElement_sel));

eyes.check(Target.frame(frame_sel, scrollRootElement_ele));
eyes.check(Target.frame(frame_sel));
eyes.check(Target.frame(frame_sel, scrollRootElement_sel));

eyes.check(Target.frame(frame_str, scrollRootElement_ele));
eyes.check(Target.frame(frame_str));
eyes.check(Target.frame(frame_str, scrollRootElement_sel));

eyes.check(Target.frame(frame_num, scrollRootElement_ele));
eyes.check(Target.frame(frame_num));
eyes.check(Target.frame(frame_num, scrollRootElement_sel));

Parameters

context
Type:
{
  frame: WebElement | Selector | string | number;
  scrollRootElement?: WebElement | Selector;
};
A literal object that defines parameters for this call:

Type definitions

Selector
Used to identify an HTML element defined as |import('selenium-webdriver').Locator|{using:string;value:string}|string|{selector:string;type:string}.
Selector
Used to identify an HTML element defined as |import('selenium-webdriver').Locator|{using:string;value:string}|string|{selector:string;type:string}.
frame_ele
Type:WebElement

If this parameter is an integer, then it represent the frame index of the required frame. If it is a string, then it represents the name or id of the required frame. Otherwise, the frame is identifed by the passed By selector or WebElement.

An element object whose bounding rectangle defines the frame to check.

scrollRootElement_ele
Type:WebElement [Optional ]

Normally, Eyes will select the most appropriate element to scroll to execute the fully method. You can use the scrollRootElement method to specify the element to scroll explicitly.

An element that should be scrolled to access the frame to be checked.

scrollRootElement_sel
Type:Selector [Optional ]

Normally, Eyes will select the most appropriate element to scroll to execute the fully method. You can use the scrollRootElement method to specify the element to scroll explicitly.

A selector to an element that should be scrolled to access the frame to be checked.

Type definitions

Selector
Used to identify an HTML element defined as |import('selenium-webdriver').Locator|{using:string;value:string}|string|{selector:string;type:string}.
frame_sel
Type:Selector

If this parameter is an integer, then it represent the frame index of the required frame. If it is a string, then it represents the name or id of the required frame. Otherwise, the frame is identifed by the passed By selector or WebElement.

A selector to an element object whose bounding rectangle defines the frame to check.

Type definitions

Selector
Used to identify an HTML element defined as |import('selenium-webdriver').Locator|{using:string;value:string}|string|{selector:string;type:string}.
frame_str
Type:string

If this parameter is an integer, then it represent the frame index of the required frame. If it is a string, then it represents the name or id of the required frame. Otherwise, the frame is identifed by the passed By selector or WebElement.

The name or id of the required frame.

frame_num
Type:number

If this parameter is an integer, then it represent the frame index of the required frame. If it is a string, then it represents the name or id of the required frame. Otherwise, the frame is identifed by the passed By selector or WebElement.

The frame index of the required frame.

Return value

Type: CheckSettings