Available in Postman: https://www.postman.com/dark-matter-505283/code-snippets/overview
A simple collection that returns a JSON response body. The URL and 'test' tab both include a dynamic variable fed from a CSV file using 'Collection Runner'.
The Set Next Request Example Collection has a working example of controlling work flows using the setNextRequest option.
Information on diferent test options and code that can be used within Postman collections.
Note; Requests use the following free API's (no auth); Swagger Pet Store | Random User | Universities List
Postman Test Examples Collection Includes... | ||
---|---|---|
Status code check | Response time check | Check data type of a response value |
Check value against list | Check JSON values in response | Body response includes a value check |
Headers exists check | Headers to have value check | If statement example |
Try and catch example | Check field value in response | Check nested field value in response |
Try and catch to allow continue on test fail | Schema Validation | Count items in array |
For each in array with if | Base64 Encode and Decode | Find in response |
Filter in response | OR | AND |
Greater than and less than | Replace a character | Math Round |
Math Round Down with Floor | Math Round Up with Ceil | Math Trunc |
Examples of displaying response data in diferent ways using the Postman vizualiser option.