Mouse over

Command value: mouseOver

Moves the mouse over an element to trigger hover menus and tooltips.

Fields

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

Usage

  • Follow it with a click or assertion on the element revealed by the hover.

Example step (JSON)

{
  "command": "mouseOver",
  "target": "nav .products"
}

Playwright equivalent

await page.locator('nav .products').hover();

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.