Skip to Content
Browser UtilswaitForNewTab

waitForNewTab

Wait for a new tab to appear without switching to it. Code continues on the current tab.

Signature

const page = await utils.waitForNewTab(options?)

Parameters

ParamTypeDefaultDescription
options.matcherstring | RegExp—Match the new tab’s title or URL
options.timeoutnumber8000Max wait time (ms)

Examples

await utils.click("#open-link"); const newPage = await utils.waitForNewTab({ timeout: 8000 }); // Still on original tab — newPage is just a reference // Match by title const tab = await utils.waitForNewTab({ matcher: "Settings" });

Error Handling

Throws if no matching tab appears within the timeout.

Last updated on