Win Element Exists
Win Element Exists
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
selector | selector | The item to check. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
session | session | Win Attach session. If omitted, the selector must include the window. |
timeout | number | Maximum in ms to wait for it to appear. 0 = immediate check (default). |
Output
Section titled “Output”Returns a boolean: true if it exists and is visible.
Example
Section titled “Example”Close an error dialog only if it appears:
Win Element Exists selector = (diálogo "Error") → output: hayErrorIf condition = = hayError └─ then: Win Click selector = (botón "Aceptar")Related activities
Section titled “Related activities”- Win Wait For — wait for (and demand) a state.
- Win Get Attribute — consultar otras propiedades.