Recall & Review
beginner
What are dynamic assertion values in Postman tests?
Dynamic assertion values are test checks that use data from the response or environment variables to verify results, instead of fixed values.
Click to reveal answer
beginner
Why use dynamic assertion values instead of static ones?
Because API responses can change, dynamic values make tests flexible and reliable by adapting to actual response data or variables.
Click to reveal answer
intermediate
Example: How to assert a response field matches an environment variable in Postman?
Use pm.expect(responseJson.field).to.eql(pm.environment.get('variableName')) to compare the response field with the environment variable.
Click to reveal answer
beginner
What Postman method helps parse JSON response for dynamic assertions?
pm.response.json() parses the response body as JSON so you can access fields for assertions.
Click to reveal answer
advanced
How can you assert that a response timestamp is recent using dynamic values?
Compare the response timestamp with the current time using JavaScript Date objects inside the test script.
Click to reveal answer
Which Postman function retrieves an environment variable for dynamic assertions?
✗ Incorrect
pm.environment.get() fetches the value of an environment variable for use in assertions.
What does pm.response.json() do in Postman tests?
✗ Incorrect
pm.response.json() parses the response body so you can access its fields for assertions.
Why are dynamic assertion values important in API testing?
✗ Incorrect
Dynamic values let tests check actual response data, making tests flexible and accurate.
How do you compare a response field to an environment variable in Postman?
✗ Incorrect
This syntax compares the response field value with the environment variable value.
Which of these is NOT a good use of dynamic assertion values?
✗ Incorrect
Asserting fixed status codes is static, not dynamic; dynamic assertions use changing data.
Explain how to write a dynamic assertion in Postman that compares a response value to an environment variable.
Think about how to access response data and environment variables in Postman scripts.
You got /3 concepts.
Describe why dynamic assertion values improve API test reliability.
Consider what happens if the API returns different data each time.
You got /4 concepts.