Skip to main content

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

ParameterTypeDescription
ctxContextThe Context to scope the selection.
selectorstringA selector to an IFrame element.
optionsWaitForSelectorOptions(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');