Skip to content

Capacity & Correctness

What Is an Assertion in Load Testing?

An assertion is a check applied to a response during a load test — on status, body, or headers — that decides whether a request genuinely succeeded.

Also known as: Validation, Check

Speed without correctness is meaningless

A load test without assertions measures how fast a server can return bytes, not whether those bytes are right. This fails in a specific and expensive way: broken responses are usually faster than working ones, because the work never happened.

An authentication service that starts rejecting every login returns in 8 ms instead of 180 ms. Without an assertion, that shows up as a dramatic performance improvement, and the run is reported as the best result the team has ever had.

What assertions check

Assertions run in order of increasing specificity, and most scenarios need more than the first one.

  • Status code — the baseline check, and the one that catches 5xx responses and unexpected redirects.
  • Body content — a JSON field, a substring, or a pattern proving the response carries real data rather than an error page rendered with a 200.
  • Headers — content type, cache directives, or a session cookie the next step depends on.
  • Response time — a threshold treated as a failure rather than just a slow sample.

Assertions feed the error rate

Assertions are how error rate becomes trustworthy. Without them, error rate only counts transport failures and bad status codes, which misses every case where the server confidently returns a well-formed wrong answer.

The practical rule is one assertion per step at minimum, checking the thing the next step depends on. A scenario whose login step asserts that a token came back cannot silently spend the rest of the run making unauthenticated requests that return fast, empty, and green.

Related terms

Ready to push your limits?

Start with 500 VUs, real cloud infrastructure, and real metrics — no credit card required. Upgrade only when you outgrow it.

Free forever — 500 VUs, 10-minute runs, no credit card