Screenshot
Screenshot
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | text | File path where to save. Ex: C:/capturas/pantalla.png. Supports expressions. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
page | session | The page session. Omit it inside a body; outside, pass = page. |
selector | selector | Capture only this element. Empty = visible page/area. |
fullPage | boolean | Capture the entire scrollable page (selector is ignored). By default false. |
format | list | Formato de imagen: png (def.) · jpeg. |
quality | number | JPEG quality 0-100 (only if format = jpeg). |
Output
Section titled “Output”Returns a string with the path of the saved file.
Example
Section titled “Example”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: " + errorRelated activities
Section titled “Related activities”- Try / Catch — capture screen when handling an error.
- Wait for Download — to download files generated by the page.