Skip to content
Recording

Assertions

The checks that make a test pass or fail, and the three ways to add them.

The Assert button (main way)

  1. While recording, click Assert, then click an element in the browser.
  2. The dialog “Assertion for: <element>” opens. Optionally tick:
    • Not — inverts the check (e.g. “is not visible”).
    • Soft — if the check fails, the test records the failure but keeps running.
  3. Pick a check:
GroupCheckMeaning
VisibilitytoBeVisibleElement is visible on the page.
toBeHiddenElement is not visible.
TexttoHaveTextElement text matches exactly (pre-filled with the current text).
toContainTextElement contains a piece of text.
toHaveValueInput has the expected value.
StatetoBeEnabled / toBeDisabledControl is interactive / disabled.
toBeChecked / not.toBeCheckedCheckbox or radio is checked / unchecked.
Collection / AttributestoHaveCountThe locator matches N elements.
toHaveAttributeAn attribute (e.g. href, aria-expanded, data-state) has a value.
toHaveClassElement has a class (partial match allowed).
PagetoHaveURLThe current page address matches (part of it or the full address).

For checks that need a value, type it and click Add Assertion (or press Enter); Back (or Esc) returns to the list.

Right-click quick assertions

While recording, right-click an element → Assert Visible, Assert Hidden or Assert Text equals.

Network assertions

In Debug → Network, select a request. Under Assertion Actions:

  • Status N — adds a step that waits for a response from that address with that status code.
  • Endpoint — adds a step that waits for a response whose address contains that path, with the observed status code.
Assertions — Actify Studio Docs