Win Get Attribute
Win Get Attribute
Section titled “Win Get Attribute”Type: win-get-attribute · Package: Desktop Activities v1.0.0 · Output: object
Gets a specific property of an element: whether it is enabled, whether it is visible, its value, its name, whether it is checked, etc. Useful for making decisions based on the state of the interface — waiting for a button to be enabled, checking if a box is checked, reading the coordinates of a control.
How it works
Section titled “How it works”Locates the element by its selector and returns the value of the property indicated in attribute.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
selector | selector | The element to consult. |
attribute | list | Property to obtain (see table below). |
Properties disponibles
Section titled “Properties disponibles”| Atributo | Returns |
|---|---|
enabled | Is it enabled? (boolean) |
visible | Is it visible? (boolean) |
value | The value of control |
name | The name of the control |
checked | Is it marked? (boxes/radios) |
selected | Is it selected? |
exists | Does the element exist? |
bounds | The coordinates/size of the control |
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 ms to wait for the element. By default 30000. |
Output
Section titled “Output”Returns a object with the property value (boolean, text, etc., depending on the attribute).
Example
Section titled “Example”Act only if the button is enabled:
Win Get Attribute selector = (botón "Procesar") attribute = enabled → output: habilitadoIf condition = = toBoolean(habilitado) └─ then: Win Click selector = (botón "Procesar")Related activities
Section titled “Related activities”- Win Get Text — read the text/value directly.
- Win Element Exists — check for existence (returns true/false).
- Win Wait For — wait for a state instead of querying it.