Element is visible

Command value: assertElementVisible

Passes when the element is present and visible on screen.

Fields

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

Usage

  • Waits up to the suite element timeout for the element to become visible.
  • Fails for elements hidden with display: none, visibility: hidden or zero size.

Example step (JSON)

{
  "command": "assertElementVisible",
  "target": "#checkout-button"
}

Playwright equivalent

await expect(page.locator('#checkout-button')).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.