Click
click performs a single left click on an element. It waits for the element to be visible and interactable before firing the event.
Shorthand
Pass a string when all you need is the element description:
yaml
- click: the sign in buttonFull form
yaml
- click:
element: the "Delete" button in the row for "invoice-2024-03"
button: left
modifiers: [shift]
count: 1Fields
| Field | Type | Description |
|---|---|---|
elementrequired | string | Description or explicit locator for the target. |
button | "left" | "right" | "middle" | Which mouse button to press. Defaults to "left". |
modifiers | ("shift"|"alt"|"ctrl"|"meta")[] | Keys held while clicking. |
count | number | Click count. 2 for a double click. Defaults to 1. |
force | boolean | Skip the interactability checks. Use sparingly. |
If the click is supposed to navigate, add a
wait-for-url step after it so the next step does not race the page transition.