TOPIC 03/1716 MINNOT STARTED

Postman tests: check the answer, keep values in variables and chain requests

Turn a request into a check that passes or fails by itself. Write a few simple tests, save a value such as a token in a variable, and use it in the next request.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a checklist on a clipboard, plus a note to self. After each stop you tick boxes. Right address. Right item. Right time. If the driver learns a gate code, they write it on the clipboard for the next stop.

Tom is a tester at Daily List, a to-do list app. He ticks the boxes and carries one code from stop to stop.

What it is: This is still Postman, the program on your computer that calls an (application programming interface). An API is the door one program uses to talk to another. script is the tick on the clipboard. It runs after the answer arrives and says pass or fail. A saved value is the note. A chained run uses that note in the next request. Postman is not the API. The script does not fix a failing API. It only reports what the answer did.

Why it matters: One request cannot prove a flow that takes two steps. Tom must sign in, keep the token and create a task the way the app does. Without a saved token, every later call fails for a boring reason, and the real bug stays hidden.

PLAIN WORDS · 1 in this section
clipboard
a board with a clip for holding papers

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Write a post-.

  1. Tick
  2. Save
  3. Reuse
Clipboard

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
A tick for a right addressA test
The gate codeA variable
Writing the code for the next stopSaving a value
The next stopThe next request

WHERE THIS PICTURE STOPS

  • A saved variable has a specific scope; narrower data/local values can shadow an environment value.
  • A failed check does not automatically stop later script statements or workflow requests.
  • A clipboard note is not a protected credential store.

HOOK

Tick, save, reuse.

TELL A FRIEND

A clipboard: tick, save, reuse.

OFTEN MIXED UP WITH Postman requests in depth: headers, JSON bodies and signing in. That topic sends a body, headers and a token by hand. This one tests the answers and carries the token in a variable.

PRACTISE AND KEEP

Sources for this topic — 3 sources
  1. Implementation-specific

    Scripts in Postman (Latest v12) ↗ — Postman · Latest v12 intro to scripts: collection→direct-child folder→request pre/post-response order, pm.test and scripts; opened 6 November 2026.

    Version-scoped product behaviour; relevant primary sections opened 6 November 2026. · Checked 2026-11-06

    Official product documentation, not a general standard. Relevant sections and exact release/access limitations are recorded in the V27 full-depth audit. Screens and rolling documentation can change; synthetic Daily List examples are editorial fixtures, not publisher product guarantees.

  2. Implementation-specific

    Store and reuse values using variables (Postman docs) ↗ — Postman · Latest v12 Variables: scope precedence, active environment, string storage and Vault; opened 6 November 2026.

    Postman documentation on variable scopes, from broadest to narrowest, and which value wins. Vendor documentation. Practitioner guidance, not a standard. · Checked 2026-11-06

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

    Verification supplement, 6 November 2026: Actual current v12 page opened: global/collection/environment/data/local scope precedence; local variable value distinct from local scope; shared values used by some cloud features. V27 supplement, 6 November 2026: relevant primary page sections actually opened; implementation-specific current product guidance, not universal standard. See full V27 audit for version and access scope.

  3. Implementation-specific

    Customize request order in a collection run ↗ — Postman · Latestv12 Customize request order: Stop a workflow,individual Send has no effect,setNextRequest always runs last; opened6 November2026. Stops downstream requests within each configured iteration,not every future iteration.

    Latest v12 setNextRequest/null workflow scope in Collection Runner,Postman CLI and Newman. · Checked 2026-11-06

    Normal web search and actual primary page opened6 November2026: Stop a workflow and Tips for building request workflows. null ends downstream work after the current request in each iteration; later iterations may run. No effect on individual Send. Subsequent script statements execute before routing. Source figure reuse permission is not claimed.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.