Tests & scripts
Automate checks with pre-request scripts and
qa.test assertions.

Pre-request Script
Runs before the request is sent. Use it to set headers, compute values, or seed collection variables.
Open the Pre-request Script tab on any request.
Tests
Runs after the response returns. Signoff uses a
qa.* dialect (familiar if you know Postman pm.*).
Example from the Starter Guide Bearer request:
qa.test("Status is 200 OK", function () { qa.response.to.have.status(200); }); var body = qa.response.json(); qa.test("Server accepted the bearer token", function () { qa.expect(body.authenticated).to.be.true; });
Assert & Extract helpers
After Send, use response actions:
| Action | Purpose |
|---|---|
| Assert | Generate test snippets from the response |
| Extract | Save response fields into variables for later requests |
Tips
- Keep assertions focused: status, one or two body fields, latency budget.
- Use the bottom Console to debug script output when a test fails.
- Run many tests together with the Collection Runner.
Next
Need something else? See the FAQ. Questions: [email protected]. Bugs: [email protected].