Postman scripting reference

Postman enables you to write your own test scripts, use predefined variables to generate sample data, and utilize JavaScript APIs to test your request and response data. Learn how to use the Postman scripting reference to extend your API testing functionality.

Test examples

You can use test script examples to write your own test scripts for requests, folders, and collections. Test scripts execute when Postman receives a response from the API you sent the request to. When you add tests to a folder or collection, they execute after each request inside it.

Dynamic variables

Postman uses the Faker library to generate sample data, including random names, addresses, email addresses, and much more. You can use these predefined variables multiple times to return different values per request. Learn how to use predefined variables.

Postman JavaScript APIs

Postman provides JavaScript APIs that you can use in your request scripts. The pm object provides functionality for testing your request and response data, with the postman object providing additional workflow control.

Last modified: 2024/01/19