sdk.automation.selectframe
Home > @matterway/sdk > Automation > selectFrame
Automation.selectFrame() function
Selects an IFrame, and returns its scoped Context.
Signature:
export declare function selectFrame(ctx: Context, selector: string, options?: WaitForSelectorOptions): Promise<Context>;
Parameters
Parameter | Type | Description |
---|---|---|
ctx | Context | The Context to scope the selection. |
selector | string | A selector to an IFrame element. |
options | WaitForSelectorOptions | (Optional) |
Returns:
Promise<Context>
A new Context scoped from the selected IFrame.
Remarks
If you need to select an iframe nested inside another iframe, use selectNestedFrame
instead.
Example
const iframeCtx = await selectFrame(ctx, 'iframe#some-frame');
await click(iframeCtx, 'button#submit');