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 type | What it runs | Best for | Rerun cost |
|---|---|---|---|
| API | HTTP requests and assertions | Status codes, payloads, auth, IDOR, rate limits | LLM-free after authoring |
| UI | Chromium actions through Playwright | Forms, redirects, visible errors, browser state | LLM-free after the replay cache is warm |
| Mixed | Browser and API steps together | Login in browser, then assert API behavior | Depends 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 withcurl, 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.