Skip to Content
Browser Utilsscreenshot

screenshot

Take a screenshot of the current page. Returns a base64-encoded string.

Signature

const base64 = await utils.screenshot(path?)

Parameters

ParamTypeDescription
pathstringOptional 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