StrikekitStrikekit

click

Click a labeled button, link, or control

Click a control by label. Optional container or table-row scoping for one-shot clicks.

Syntax

When I click on "<target>" [by …]
When I click on "<target>" in "<container>"
When I click on "<target>" in row "<row-key>"
When I click on "<header>" column

Qualifiers

QualifierRoleExample
onTarget labelclick on "Login"
inOne-shot click inside a container (does not change the in stack)click on "Delete" in "Laptop"
in rowScope to a table row by cell textclick on "Edit" in row "chamodh@example.com"
columnPrefer columnheader / th text match, then clickclick on "Name" column
by …Optional find hint after the targetclick on "Security" by aria-label · see also Find hints (by attribute, auto data-* presence)

Requirements

ItemContract
Element / control shapeAuto-find: any element with matching id, data-testid, or aria-label; or [role=tab] with exact text; or visible text on button / a / input[type=button] only; or input[type=submit][value]. Late unique data-* presence fallback on web.
How the label bindsDefault order: id → data-testid → aria-label → role tab + text → visible text (button/a/input[type=button]) → submit value
Qualifiers that change resolveby … replaces the auto chain. in / in row use container/row + action sets that include [role=button]. column resolves role=columnheader / th only.
PlatformWeb (Playwright). Same label grammar on mobile where supported.
Wrong shape → use insteadPlain <div>Login</div> fails on visible text. <div role="button">Login</div> fails on default visible-text click — use by text, by role "button", id/testid/aria-label, or click … in / in row. Radix menuitem → click trigger + item by id.

When it fails

  • timed out / element not found — often wrong control shape (div without button/link/role), not a typo.
  • ambiguous — duplicate labels or glob matched multiple controls.
  • element is disabled — resolved a disabled control.

See also UI contracts.

Examples

When I click on "Login"
When I click on "Delete" in "Laptop"
When I click on "Edit" in row "chamodh@example.com"
When I click on "Security" by role "tab"
When I click on "Name" column
When I click on "Save*"

Notes

  • "Save*" on the target is a glob — must match exactly one visible control.
  • click on "…" column prefers column headers and does not change default click on strategy order.

On this page