Skip to main content

Assertions

info

Before you start.

  • You need a case with a Request. To check an extracted value, add an Extract rule first.
  • Run the case once after you set up the checks, to see how each rule behaves (Running tests).

The Assertions tab​

REQUEST ASSERTIONS and RESPONSE ASSERTIONS ("n configured"), Add request assertion, Add response assertion, From definition buttons. A new case already has one row with Source = STATUS.

REQUEST ASSERTIONS and RESPONSE ASSERTIONS ("n configured"), Add request assertion, Add response assertion, From definition buttons. A new case already has one row with Source = STATUS.

Purpose: decide when the case counts as passed. Response rules are evaluated first, then request rules; both groups are optional (REQUEST ASSERTIONS and RESPONSE ASSERTIONS).

ColumnSource / optionsFunction & result
SourceResponse: STATUS, HEADER, BODY_JSONPATH, BODY_XPATH, BODY_RAW, RESPONSE_TIME, VARIABLE. Request: REQ_HEADER, REQ_BODY_JSONPATH, REQ_BODY_XPATH, REQ_BODY_RAWWhat is checked. VARIABLE checks a variable's value (fill with {{doc.name}}).
Path / fieldYou enter; only appears when the source needs a pathJSONPath/XPath or header name.
OperatorEQUALS, NOT_EQUALS, CONTAINS, NOT_CONTAINS, STARTS_WITH, ENDS_WITH, MATCHES_REGEX, IN_LIST, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, EXISTS, NOT_EXISTS, IS_NULL, IS_NOT_NULL, IS_EMPTY, IS_NOT_EMPTYHow to compare. The applicable list depends on the Source. IN_LIST: the value must be one of a comma-separated list (e.g. MYR,USD); EXISTS: the path exists; IS_EMPTY: empty.
ExpectedYou enter; {{variable}}, {{data.1.column}}, {{doc.x}} allowedThe comparison value. An unresolved variable makes the case Blocked. Not used for operators such as IS_NULL/EXISTS.
For eachCheckboxApplies the rule to every element of the array returned by the path.
Check onEvery iteration / Last iterationOnly relevant when the case repeats. "Last iteration" waits and checks once after the final round (e.g. an accumulated total; if chosen wrongly, the rule fails until the last page).
On failContinue / StopIf this rule fails: continue checking other rules, or stop.
Actions (delete)—Deletes the rule.
Add request assertion, Add response assertion, From definition buttons (dashed)—The first two add a row to their group. From definition opens rule suggestions from a definition (WSDL/OpenAPI/Inferred) when one exists.
"How a case outcome is decided" panel—Passed: all rules pass. Failed: some failed and none is blocked. Blocked: a rule could not be evaluated (unfilled variable, invalid path, body not parseable), even if other rules failed. A configured Compare with nothing to compare is also Blocked (COMPARE_NOTHING_TO_COMPARE). With no rules at all, the case passes on successful execution alone.