Click element (detailed)
Referenced In
Fields
| Field | Type | Description | Default |
|---|---|---|---|
| button | string | Optional. Kind of click to perform. Accepted values: left, right, middle | — |
| duration | integer | Optional. How long to hold the press, in milliseconds. A long-press (touch-and-hold) on mobile app surfaces; press-and-hold of the button on desktop apps and browsers. Omit for a normal click. Minimum: 1 | — |
| surface | one of: - string - object(Browser surface) - object(App surface) | Optional. The browser window/tab or app window this step acts on. Omit to act on the active surface — the most recently opened, focused, or explicitly targeted surface, whatever its kind. Specifying a surface switches the active surface for the steps that follow. App surfaces use the object form ({ “app”: … }). | — |
| elementText | string | Optional. Display text of the element to click. If combined with other element finding fields, the element must match all specified criteria. | — |
| selector | string | Optional. Selector of the element to click. If combined with other element finding fields, the element must match all specified criteria. | — |
| elementId | string | Optional. ID attribute of the element to click. Supports exact match or regex pattern using /pattern/ syntax. | — |
| elementTestId | string | Optional. data-testid attribute of the element to click. Supports exact match or regex pattern using /pattern/ syntax. | — |
| elementClass | one of: - string - array of string | Optional. Class or array of classes that the element must have. Each class supports exact match or regex pattern using /pattern/ syntax. Element must have all specified classes. | — |
| elementAttribute | object | Optional. Object of attribute key-value pairs that the element must have. Values can be strings (supporting /pattern/ regex), numbers, or booleans. Boolean true matches attribute presence, false matches absence. | — |
| elementAria | string | Optional. Computed accessible name of the element per ARIA specification. Supports exact match or regex pattern using /pattern/ syntax. | — |
Examples
{"button": "left","duration": 42,"surface": "chrome","elementText": "example","selector": "example","elementId": "example","elementTestId": "example","elementClass": "example","elementAttribute": {},"elementAria": "example"}