How-to
Hidden assert (toBeHidden)
Hidden assert (toBeHidden)
Expect assertion: Target is hidden or absent. A failed step fails the autotest result.
Step model
action_name | toBeHidden |
| Group | Expect |
| Target | Required |
| Value | Unused |
| expected_value | Unused |
| TEST_ACCOUNT | Forbidden |
| Do not confuse with | toBeVisible, waitForSelector |
Target/Value facts match the source-of-truth catalog and Autotest step.
Prerequisites
- You know the locator of the element that must disappear.
Steps
- Add a
toBeHiddenstep. - Set Target.
- Leave Value empty.
- Save.
The step is stored on the autotest. Next - neighbouring steps or autotest run creation.
Examples
Dialog is closed
Fields in the UI:
| Field | Value |
|---|---|
action_name | toBeHidden |
| Target | kind ROLE, value dialog, name Cookie |
Step JSON fragment (copy-paste):
json
{
"action_name": "toBeHidden",
"target": {
"kind": "ROLE",
"value": "dialog",
"name": "Cookie"
}
}Common mistakes
- Both a hidden element and a missing element pass this assert.
Screenshots
Screenshots of the step form for toBeHidden will be added here in a later pass.
Did this page help?