Skip to main content

sdk.automation.gotopage

Home > @matterway/sdk > Automation > goToPage

Automation.goToPage() function

Navigates to the specified URL in the given browser tab.

Signature:

export declare function goToPage(ctx: Context, url: string, options?: WaitForOptions): Promise<void>;

Parameters

ParameterTypeDescription
ctxContextContext object.
urlstringURL to navigate to.
optionsWaitForOptions(Optional) Optional Puppeteer options for waiting.

Returns:

Promise<void>

Example

// Navigates to "https://example.com" and waits until the network is idle for 1 second.
await goToPage(ctx, 'https://example.com', { waitUntil: 'networkidle0', timeout: 1000 });