screenshot
Take a screenshot of the current page. Returns a base64-encoded string.
Signature
const base64 = await utils.screenshot(path?)Parameters
| Param | Type | Description |
|---|---|---|
path | string | Optional file path to save screenshot |
Examples
// Get base64 string
const img = await utils.screenshot();
// Save to file
await utils.screenshot("/tmp/debug.png");Error Handling
Soft fail — returns null on failure. Does not throw.
Last updated on