Element is not present
Command value: assertElementNotPresent
Passes when the element is not in the page (in the DOM, visible or not). Waits up to the suite element timeout.
Fields
| Field | JSON property | Description |
|---|---|---|
| CSS or XPath Selector | target | Element 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.
- When the element is absent, the step waits the full suite element timeout before passing. Use Wait for element is not present for a faster check.
Example step (JSON)
{
"command": "assertElementNotPresent",
"target": ".error-banner"
}Playwright equivalent
await expect(page.locator('.error-banner')).not.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.