Win Screenshot
Win Screenshot
Section titled “Win Screenshot”Type: win-screenshot · Package: Desktop Activities v1.0.0
Takes a screenshot of the entire window or a specific element and saves it to an image file. Very useful for leaving evidence of what the bot did and, above all, for diagnosing failures in unattended executions: a screenshot in the catch shows you what the application was like when something went wrong.
How it works
Section titled “How it works”Captures the selector element, or—if you omit it—the entire window of the session, and saves it to path (.png or .jpg).
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
path | expression | Output file path (.png, .jpg). Supports expressions. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
session | session | Win Attach session. If omitted, the selector must include the window. |
selector | selector | Element to capture. If omitted, captures the entire window (requires a session). |
timeout | number | Maximum ms to wait for the element. By default 30000. |
Example
Section titled “Example”Capture the window if something goes wrong, for diagnosis:
Try / Catch errorVariable = error ├─ try: │ Win Click selector = (botón "Procesar") │ Win Wait For selector = (etiqueta "Listo") state = visible └─ catch: Win Screenshot session = = app path = = "C:/evidencias/error_" + now().ToString("yyyyMMdd_HHmmss") + ".png" Log level = error message = = "Fallo al procesar: " + errorRelated activities
Section titled “Related activities”- Try / Catch — capture screen when handling an error.
- Win Get Text — read a specific piece of data instead of an image.