Protocol Lab · Status Codes

Every status code a UI test trips over, served for real: 200/301/404/418/500 and more, as links or from an in-page fetch console.

Order any status code off the menu — 200 to 503, teapots included.

Status Codes is a medium Network & Auth challenge on Fun UI Playground. Every status code a UI test trips over, served for real: 200/301/404/418/500 and more, as links or from an in-page fetch console. It needs the site’s live backend for real HTTP behavior. Every interactive element carries a stable id and data-testid prefixed with “status-codes-”, and the techniques it exercises are assert response status, redirect following, network interception, error-page handling.

At a glance

Category
Network & Auth
Difficulty
medium
Teaches
assert response status · redirect following · network interception · error-page handling
Backend
Needs the live /api backend
Locators
Stable id and data-testid, prefixed status-codes-

Selectors on this page

LocatorWhat it is
#status-codes-fetch-<code> #status-codes-resultThe in-page console buttons (#status-codes-fetch-<code>) fetch client-side and print the status line to #status-codes-result

Frequently asked questions

How do I assert an HTTP status code from a UI test?

Request /api/status/<code> and read the response rather than the rendered page — 200, 201, 204, 301, 302, 400, 401, 403, 404, 405, 418, 429, 500, 502 and 503 are all served for real. The in-page buttons #status-codes-fetch-<code> print the status line into #status-codes-result.

How do I test redirect handling?

301 and 302 respond with Location: /api/status/200, so you can assert the whole redirect chain — or disable redirect following and assert the 3xx itself. An unknown code answers 400 with an explanatory body.

More Network & Auth

Updated

Fun UI Playground — all challenges, bug hunts, getting started, glossary, about.