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
| Param | Type | Default | Description |
|---|---|---|---|
options.matcher | string | RegExp | — | Match the new tab’s title or URL |
options.timeout | number | 8000 | Max 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