Skip to content

Win Element Exists

Type: win-element-exists  ·  Package: Desktop Activities v1.0.0  ·  Output: boolean

Checks whether an element exists and is visible in the application, and returns true or false. Does not fail if the element is not there: it simply returns false. It’s the way to handle interfaces that sometimes show something — an error dialog, a message, a conditional button.

Search for the element by its selector. By default (timeout = 0) it does an immediate check. With a larger timeout, wait until that time for it to appear before returning false. The result usually feeds an If.

ParameterEditorDescription
selectorselectorThe item to check.
ParameterEditorDescription
sessionsessionWin Attach session. If omitted, the selector must include the window.
timeoutnumberMaximum in ms to wait for it to appear. 0 = immediate check (default).

Returns a boolean: true if it exists and is visible.

Close an error dialog only if it appears:

Win Element Exists selector = (diálogo "Error") → output: hayError
If condition = = hayError
└─ then:
Win Click selector = (botón "Aceptar")