Wait for element present

Command value: assertElementPresentUntil

Waits until the element is in the page, failing if the timeout passes first.

Fields

FieldJSON propertyDescription
CSS or XPath SelectortargetElement the step acts on, for example #login, .cart button or //button[text()='Save'].
Input valuevalueMaximum time to wait, in milliseconds. The form accepts multiples of 1000, starting at 1000.

Usage

  • Use when content loads asynchronously, for example search results or a toast.
  • The timeout is in milliseconds. The step finishes as soon as the condition is met, so a generous timeout costs nothing on fast runs.

Example step (JSON)

{
  "command": "assertElementPresentUntil",
  "target": ".search-results li",
  "value": "10000"
}

Playwright equivalent

await expect(page.locator('.search-results li').first()).toBeAttached({ timeout: 10000 });

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.