Skip to content

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.

Captures the selector element, or—if you omit it—the entire window of the session, and saves it to path (.png or .jpg).

ParameterEditorDescription
pathexpressionOutput file path (.png, .jpg). Supports expressions.
ParameterEditorDescription
sessionsessionWin Attach session. If omitted, the selector must include the window.
selectorselectorElement to capture. If omitted, captures the entire window (requires a session).
timeoutnumberMaximum ms to wait for the element. By default 30000.

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: " + error
  • Try / Catch — capture screen when handling an error.
  • Win Get Text — read a specific piece of data instead of an image.