activeIframe
Switch scope into an iframe. After calling this, all methods operate inside the iframe.
Signature
const frame = await utils.activeIframe(selector, options?)Parameters
| Param | Type | Default | Description |
|---|---|---|---|
selector | string | — | CSS selector or XPath of the iframe |
options.waitTimeout | number | 0 | Max wait time for iframe (ms). Default: instant |
Examples
// Instant — iframe must already exist
await utils.activeIframe("#my-iframe");
await utils.click("#btn-in-iframe");
await utils.activeMainFrame(); // exit iframe
// Wait for iframe to appear
await utils.activeIframe("#lazy-iframe", { waitTimeout: 8000 });Error Handling
Throws if the iframe is not found.
Last updated on