Skip to main content

sdk.automation.createpage

Home > @matterway/sdk > Automation > createPage

Automation.createPage() function

Creates a new browser tab, and returns its scoped Context.

Signature:

export declare function createPage(ctx: Context, url?: string): Promise<Context>;

Parameters

ParameterTypeDescription
ctxContextContext object.
urlstring(Optional) URL to navigate to.

Returns:

Promise<Context>

Context object where page is the newly created tab.

Remarks

The tab will be created in the same browser of the given ctx.

Example

const newPageCtx = await createPage(ctx, 'https://example.com');
await click(newPageCtx, 'button[id="submit"]');