Click

Command value: click

Clicks an element with the left, right or double click.

Fields

FieldJSON propertyDescription
TargettargetCSS selector or XPath of the element the step acts on, for example #login or //button[text()='Save'].
Click Typevalueleft (default), right for the context menu, or double.
Description (Optional)notesA comment shown in the step list and in Gherkin and Playwright exports.

Usage

  • The runner waits for the element to be present before clicking.
  • The step fails without clicking if another element, such as a cookie banner, covers the target. Dismiss it in an earlier step.
  • Prefer stable selectors such as ids or data-test attributes over generated class names.

Example step (JSON)

{
  "command": "click",
  "target": "button[type='submit']",
  "value": "left"
}

Playwright equivalent

await page.locator("button[type='submit']").click();
// right: .click({ button: 'right' })  double: .dblclick()

Common options

  • Make this step optional (Continue on failure): when checked, a failure in this step is recorded and the test continues with the next step.
  • Execute step when JavaScript returns true: runs the step only when the JavaScript condition returns true. Otherwise the step is skipped.

See conditional steps and variables for details.