Element is not visible

Command value: assertElementNotVisible

Passes when the element is hidden or not in the page.

Fields

FieldJSON propertyDescription
CSS or XPath SelectortargetElement the step acts on, for example #login, .cart button or //button[text()='Save'].

Usage

  • Use it to confirm a modal closed or a section collapsed.

Example step (JSON)

{
  "command": "assertElementNotVisible",
  "target": "#cookie-dialog"
}

Playwright equivalent

await expect(page.locator('#cookie-dialog')).not.toBeVisible();

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.