frame method

Class: TargetPlatform: PuppeteerLanguage: 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: ElementHandle | Selector | string | number;
  scrollRootElement?: ElementHandle | Selector;
};
A literal object that defines parameters for this call:
frame_ele
Type:ElementHandle

The element that contains the frame to be checked.

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

scrollRootElement_ele
Type:ElementHandle [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 string|{selector:string;type:string}.
frame_sel
Type:Selector

The element that contains the frame to be checked.

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 string|{selector:string;type:string}.
frame_str
Type:string

The element that contains the frame to be checked.

The name or id of the required frame.

frame_num
Type:number

The element that contains the frame to be checked.

The frame index of the required frame.

Return value

Type: CheckSettings