Skip to main content

What’s the difference between an API scenario and a UI scenario?

API scenarios test your application through HTTP. UI scenarios test your application through the browser, the way a user experiences it. Both are reusable Qodex scenarios. The right choice depends on what kind of behavior you need to prove.

Quick comparison

Scenario typeWhat it runsBest forRerun cost
APIHTTP requests and assertionsStatus codes, payloads, auth, IDOR, rate limitsLLM-free after authoring
UIChromium actions through PlaywrightForms, redirects, visible errors, browser stateLLM-free after the replay cache is warm
MixedBrowser and API steps togetherLogin in browser, then assert API behaviorDepends on the step type

Use API scenarios when

  • The behavior can be tested with raw HTTP.
  • You care about response shape, status code, headers, or payload values.
  • You are testing authorization, mass assignment, rate limits, or API contracts.
  • You want the fastest and cheapest replay path.

Use UI scenarios when

  • The visible user experience matters.
  • The flow includes redirects, forms, modals, OAuth, or browser-only state.
  • You need screenshots or step artifacts.
  • The bug cannot be proven from API traffic alone.

Simple rule

If the bug can be reproduced with curl, use an API scenario. If you need to see what the user sees, use a UI scenario.

Next steps

Scenarios concept

Understand reusable Qodex scenarios.

API testing scenarios

Create direct endpoint tests.

Intent-driven UI scenarios

Create browser-driven tests.

LLM cost on reruns

Understand why saved scenarios rerun cheaply.