Skip to navigation

Click element (detailed)

Referenced In

Fields

FieldTypeDescriptionDefault
buttonstringOptional. Kind of click to perform.

Accepted values: left, right, middle
—
durationintegerOptional. 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
—
surfaceone 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”: … }).—
elementTextstringOptional. Display text of the element to click. If combined with other element finding fields, the element must match all specified criteria.—
selectorstringOptional. Selector of the element to click. If combined with other element finding fields, the element must match all specified criteria.—
elementIdstringOptional. ID attribute of the element to click. Supports exact match or regex pattern using /pattern/ syntax.—
elementTestIdstringOptional. data-testid attribute of the element to click. Supports exact match or regex pattern using /pattern/ syntax.—
elementClassone 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.—
elementAttributeobjectOptional. 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.—
elementAriastringOptional. 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"
}