Skip to content

Screenshot

Type: page-screenshot  ·  Package: Browser v1.0.0  ·  Output: string

Takes a screenshot of the entire page, the visible area, or a specific element, and saves it to an image file. Returns the file path. It is very useful for leaving evidence of what the bot did (a receipt, a status) and, above all, for diagnosing failures in unattended executions: a screenshot on the catch shows you what the screen was like when something went wrong.

Captures the page (or element from selector) and saves it to path, in PNG (default) or JPEG format. Returns the path of the saved file.

ParameterEditorDescription
pathtextFile path where to save. Ex: C:/capturas/pantalla.png. Supports expressions.
ParameterEditorDescription
pagesessionThe page session. Omit it inside a body; outside, pass = page.
selectorselectorCapture only this element. Empty = visible page/area.
fullPagebooleanCapture the entire scrollable page (selector is ignored). By default false.
formatlistFormato de imagen: png (def.) · jpeg.
qualitynumberJPEG quality 0-100 (only if format = jpeg).

Returns a string with the path of the saved file.

Save evidence with a dated name, and capture the screen if something goes wrong:

Try / Catch errorVariable = error
├─ try:
│ Page Click selector = (#pagar)
│ Page Screenshot path = = "C:/evidencias/pago_" + now().ToString("yyyyMMdd_HHmmss") + ".png" fullPage = true
└─ catch:
Page Screenshot path = "C:/evidencias/ERROR.png" fullPage = true
Log level = error message = = "Fallo en el pago: " + error