1. Docs
  2. Reference
  3. Step reference
  4. Checks and assertions

Checks and assertions

A test proves something only when it checks a result. The Assertion step compares a value from your run with the value you expect and stops the test case when they do not match.

5 min read Updated CustomersAdmins

In short

On this page you can

  • Compare a saved value with an expected one using an Assertion Type such as Equals.
  • Check numbers with Greater Than or Less Than, and text with Contains.
  • Check that a value is empty or filled with Is Empty and Is Not Empty.
  • Choose between Assertion, Visibility Check, AI Check and Network Check.
  • Read the expected, actual and comparison lines of a failed check in the log.

How to use it

  1. Save the value to check in a variable first, for example with a Get or API step.
  2. Click Assert, pick a Page Name, an Assertion Type and a Test Step Name, then Add.
  3. Select the step and set actual to the variable, for example {{tc:orderTotal}}.
  4. Set expected to the value you want, or leave it out for Is Empty and Is Not Empty.
  5. Run a Dry Run; a mismatch stops the case and shows both values.

Choose the right check#

CheckUse it to verifyOn failureProject types
Assertion (Assert)A value saved by an earlier step: a text, a number, a status code, a database columnFAILED, case stopsAll
Visibility CheckAn element or a text is visible on the web pageFAILED, case continuesWEB
AI CheckSomething you can see on the screen, described in wordsFAILED, stops when stop-on-error is setAll, AI enabled
Network CheckA call the browser made: status, body field, header, durationFAILED, case stopsWEB
Assert Visible, Assert Not Visible, Assert TextAn element on a mobile screenFAILED, case stopsMOBILE
Assert Visible … Assert CheckedA control of a desktop app: visible, enabled, checked, textFAILED, case stopsDESKTOP
Python or JavaScript with STATUSAny rule you can write as codeERROR, case stopsPython all, JS web

Add an Assertion step#

  1. Save the value first

    An assertion compares values; it does not read the page. Put the value into a variable with a step before it: Get, an API JSON path, a Database output, a code step or an AI Ask.

  2. Open the dialog

    Click Assert in the step toolbar. The dialog Add Assertion/Verify opens.

  3. Fill the three fields

    Page Name: the page the check belongs to (pick one or type a new name). Assertion Type: the comparison, each with a short description. Test Step Name: what you check, for example Total is above 1000. Add stays disabled until all three are filled.

  4. Set actual and expected

    Select the new step. In the right panel set actual to the variable ({{tc:orderTotal}}) and expected to the value you want (1000). You can change the assertion type there too; types that need no expected value remove the expected row.

    The step shows the chip Verify.

  5. Save and run

    Click Save and run a Dry Run.

Add Assertion/Verify dialog with Page Name, the Assertion Type list open showing types and descriptions, and Test Step Name
The Add Assertion/Verify dialog.

Assertion types#

The list shows the assertion types set up for your installation. By default these ten:

TypePasses whenNeeds expectedExample (actual → expected)
EqualsThe values are exactly equal.YesPaid → Paid
Not EqualsThe values are not equal.YesDraft → Paid
ContainsThe value includes the expected text.YesOrder 1042 created → created
Not ContainsThe value does not include it.YesSaved → Error
Starts WithThe value starts with the expected text.YesINV-2026-17 → INV-
Ends WithThe value ends with the expected text.Yesreport.pdf → .pdf
Is EmptyThe value is empty or blank.No
Is Not EmptyThe value is not empty.NoeyJhbGciOi…
Greater ThanThe value is a number greater than expected.Yes1234.5 → 1000
Less ThanThe value is a number less than expected.Yes850 → 2000

How values are compared#

  • Text is case-sensitive and not trimmed. paid does not equal Paid, and Paid (with a space) does not equal Paid. Clean values with a transform on the Get step (Trim, Lower Case).
  • Equals and Not Equals compare numbers as numbers when both sides are plain numbers: 76 equals 76.0. Otherwise they compare the exact text.
  • Greater Than and Less Than need numbers on both sides. If not, the step stops with “Actual is not a number: '…'” or “Expected is not a number: '…'”. A value such as € 1.234,50 needs the To Number transform first.
  • Missing variables count as empty. If {{tc:orderTotal}} was never set, the live log says “{{tc:orderTotal}} not found, treated as empty” and the comparison uses an empty value.
  • The runner also understands Greater Than Or Equal, Less Than Or Equal, Matches Regex (matched from the start of the value), Is True (true, 1, yes) and Is False, if your list offers them.
Equals decisionAssertion step, live log line “Comparison”
if actual and expected are both plain numbers:  pass = number(actual) == number(expected)   (Comparison: number)
otherwise:                                     pass = actual == expected                   (Comparison: text)

Example: actual {{tc:qty}} resolves to 3.0, expected 3. Both are numbers, 3.0 = 3, so the step passes. With expected 3 pcs the comparison is text, 3.0 ≠ 3 pcs, and the step fails.

What the log shows#

Example · a failed assertion in the report
Assertion FAILED (Total is above 1000)
----------------------------------------
Assertion Type: Greater Than
Expected: {{tc:limit}} → '1000'
Actual: {{tc:orderTotal}} → '850'
Comparison: number

A failed assertion ends the step as FAILED and stops the test case. Configuration problems also stop it, with a line under “Assertion configuration error”:

  • “No assertion type is selected for this step — choose one (for example Equals)”
  • “Unsupported assertion type: '…' — choose a type from the list (for example Equals)”
  • “Expected is empty — enter the text to look for with '…'”
  • “'expected' value was not found for type '…'” and “'actual' value was not found for type '…'”

Each one has a fix in Troubleshooting › Checks.

Common patterns#

GoalSteps
The success message appearsGet message → Assertion {{tc:message}} Contains saved
An API returned 201API step with JSON path @status into status → Assertion {{tc:status}} Equals 201
The database row has the new statusDatabase step with output status → Assertion {{tc:status}} Equals SHIPPED
The UI shows what the API returnedAPI step into apiName, Get into uiName → Assertion {{tc:uiName}} Equals {{tc:apiName}}
A token was issuedAPI step with JSON path data.token into token → Assertion Is Not Empty

Auto-heal can also repair an assertion whose expected value differs only in format (Equals, Contains, Starts With, Ends With). Such repairs wait for review in Maintenance.

Didn’t find your answer?Write to support with your project name and what you see on screen.

info@smartestqa.ai
© 2026 Selenity Technology · SmartestQAsmartestqa.aiThis page as MarkdownChecked against smarttest-fe predev 2a8c79cc, smarttest-be 633c2a03, smarttest-testsuite 017fcec