Element is present

Command value: assertElementPresent

Passes when the element is in the page (in the DOM, visible or not). Waits up to the suite element timeout.

Fields

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

Usage

  • Checks the DOM only. Use the visibility assertions when the element must be shown on screen.
  • Useful as a guard before interacting with an element.

Example step (JSON)

{
  "command": "assertElementPresent",
  "target": "#user-menu"
}

Playwright equivalent

await expect(page.locator('#user-menu')).toBeAttached();

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.