-
Notifications
You must be signed in to change notification settings - Fork 5
Tests and Chaining
Getman has a no-code rules engine, configured per request in the RULES tab. It does two things after each send:
- Assertions — verify conditions about the response (pass/fail).
- Extractions — capture values from the response into Environments and Variables variables, so the next request can use them ("chaining").
Results show in the Responses of the response panel.
The RULES tab has two sections — EXTRACT VARIABLES and ASSERTIONS — each with an add button and a list of rule cards. Every rule has an on/off toggle and a delete (trash) button. Rules are stored per request and run automatically on every send.
Click ADD ASSERTION. Each assertion has a target, a comparator, and (usually) an expected value.
| Target | Checks | Needs a path? |
|---|---|---|
| STATUS | HTTP status code | — |
| TIME (ms) | Response duration in ms | — |
| BODY (JSONPath) | A value at a JSONPath in the JSON body (e.g. $.data.id) |
JSONPath |
| HEADER | A response header value (case-insensitive name) | header name |
| Comparator | Meaning | Expected value |
|---|---|---|
= (equals) |
exact string match | any |
≠ (not equals) |
not equal | any |
contains |
actual contains expected substring | any |
< (less than) |
numeric: actual < expected | number |
> (greater than) |
numeric: actual > expected | number |
in range |
numeric: lo ≤ actual ≤ hi |
lo-hi (e.g. 200-299) |
exists |
the header/JSONPath is present | — (no expected) |
The matching fields adapt to your choice (a JSONPath/header field appears for those targets; the EXPECTED field hides for exists and becomes lo-hi for in range).
-
STATUSin range200-299— succeeded? -
TIME (ms)<800— fast enough? -
BODY (JSONPath)$.tokenexists— got a token? -
HEADERContent-Typecontainsapplication/json— right type?
Each result in the TESTS tab shows a ✓/✗, a readable label, and the actual value found.
Click ADD EXTRACTION. Each rule reads a value from the response and writes it to an environment variable.
Shortcut: in the response BODY pane's Responses#tree-view view, open any node's ⋮ menu and choose Extract to {{var}} — it adds a JSON-path extraction rule for that exact node (with a suggested variable name) without hand-typing the path. Refine the variable name here in the RULES tab.
| Kind | Expression | Reads |
|---|---|---|
| JSON PATH | a JSONPath (e.g. $.data.token) |
a value from the JSON body |
| HEADER | a header name | a response header value (case-insensitive) |
| REGEX | a regex pattern | capture group 1 (or the whole match) against the body text |
Set TARGET VARIABLE to the environment variable name to write (e.g. auth_token).
After a send, each enabled extraction with a target runs:
- On success, the captured value is written into the active environment (a toast confirms:
Captured → {{auth_token}}, …). - If no environment is active, captures are held pending and Getman tells you to select one; they're flushed once you pick an environment.
- Captures are de-duplicated so each is written once per send.
-
Login request with an extraction: JSON PATH
$.token→auth_token. -
Subsequent requests use
Authorization: Bearer {{auth_token}}(set in the Authentication or a header). - Send the login once; every later request now carries the fresh token.
On each send: the request is sent (with variables resolved) → the response arrives → extractions and assertions run against the decoded body → the TESTS tab updates → captured values are written back to the active environment.
Getman on GitHub · Releases · Live demo · Local-first HTTP client — no account, no cloud, no telemetry.
Start here
Core
Variables & automation
More features
- History
- Cookies
- Realtime WebSocket and SSE
- Code Generation
- Command Palette
- Keyboard Shortcuts
- Auto-Update
Configuration
Project