Wait for element is not present

Command value: assertElementNotPresentUntil

Waits until the element is not 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 after an action that removes something, such as a loading spinner or a dismissed dialog.
  • 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": "assertElementNotPresentUntil",
  "target": ".spinner",
  "value": "15000"
}

Playwright equivalent

await expect(page.locator('.spinner')).not.toBeAttached({ timeout: 15000 });

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.