What is the purpose of saving responses in Postman?
Saving responses helps you keep a record of API replies for later review, debugging, or comparison without needing to resend the request.
Click to reveal answer
beginner
How can you save a response manually in Postman?
After sending a request, click the 'Save Response' button in the response section to store the response for future reference.
Click to reveal answer
intermediate
What is a practical use of saving responses during API testing?
You can compare saved responses to check if changes in the API affect the output, helping catch bugs or unexpected behavior.
Click to reveal answer
intermediate
Can Postman save responses automatically? If yes, how?
Yes, by writing scripts in the 'Tests' tab, you can save parts of the response to variables automatically after each request.
Click to reveal answer
intermediate
What is the benefit of saving responses as examples in Postman?
Saving responses as examples helps document the API behavior and share expected outputs with your team, improving communication and testing clarity.
Click to reveal answer
What button do you click to save a response manually in Postman?
ASave Response
BSend
CNew Request
DClear
✗ Incorrect
The 'Save Response' button stores the current response for later use.
Why is saving responses useful in API testing?
ATo avoid sending requests again
BTo keep a record for debugging and comparison
CTo speed up the API server
DTo delete old requests
✗ Incorrect
Saving responses helps testers review and compare API outputs without resending requests.
Which Postman feature allows automatic saving of response data?
APre-request scripts
BCollection runner
CEnvironment variables
DTests scripts
✗ Incorrect
Tests scripts run after a request and can save response data automatically.
What is an example in Postman used for?
ATo save a response snapshot
BTo save a request template
CTo run multiple requests
DTo clear environment variables
✗ Incorrect
Examples save response snapshots to document API behavior.
Where do you find the 'Save Response' button in Postman?
AIn the request builder
BIn the collection runner
CIn the response viewer
DIn the environment settings
✗ Incorrect
The 'Save Response' button is located in the response viewer after sending a request.
Explain how to save a response manually in Postman and why it is useful.
Think about what you do after you get a reply from the API.
You got /3 concepts.
Describe how you can automate saving parts of a response in Postman.
Scripts run after the request to handle response data.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of saving responses in Postman?
easy
A. To speed up the API server
B. To delete old API requests automatically
C. To keep track of API outputs for later use
D. To change the API endpoint URL
Solution
Step 1: Understand the role of saving responses
Saving responses allows testers to keep the output data from API calls for future reference or validation.
Step 2: Identify the correct purpose
Among the options, only keeping track of API outputs matches the purpose of saving responses.
Final Answer:
To keep track of API outputs for later use -> Option C
Quick Check:
Saving responses = keep API outputs [OK]
Hint: Saving responses means storing API outputs for reuse [OK]
Common Mistakes:
Confusing saving responses with deleting requests
Thinking it speeds up the server
Assuming it changes API URLs
2. Which Postman script command is used to save a value from a response into an environment variable?
easy
A. pm.response.save()
B. pm.environment.set()
C. pm.request.store()
D. pm.variable.get()
Solution
Step 1: Recall Postman scripting commands
To save data into environment variables, Postman uses the command pm.environment.set(variableName, value).
Step 2: Match the command to the options
Only pm.environment.set() correctly saves a value into an environment variable.
Final Answer:
pm.environment.set() -> Option B
Quick Check:
Save to environment = pm.environment.set() [OK]
Hint: Use pm.environment.set() to save response data [OK]
Common Mistakes:
Using pm.response.save() which does not exist
Confusing get() with set()
Trying to save with pm.request.store() which is invalid
3. Given this Postman test script, what will be the value saved in the environment variable 'userId' if the response JSON is {"id": 42, "name": "Alice"}?
let jsonData = pm.response.json();
pm.environment.set('userId', jsonData.id);
medium
A. 42
B. null
C. undefined
D. "Alice"
Solution
Step 1: Parse the response JSON
The response JSON has an "id" field with value 42 and a "name" field with "Alice".
Step 2: Check the script saving the value
The script saves jsonData.id into 'userId', so it saves 42.
Final Answer:
42 -> Option A
Quick Check:
jsonData.id = 42 [OK]
Hint: jsonData.id saves the number 42 from response [OK]
Common Mistakes:
Saving the name instead of id
Assuming undefined if JSON parsing fails
Confusing string and number values
4. You wrote this test script to save a token from response but it does not save correctly:
let jsonData = pm.response.json();
pm.environment.set('token', jsonData.token);
What is a likely reason the token is not saved?
medium
A. The response does not contain a 'token' field
B. pm.environment.set() is not a valid function
C. You must use pm.response.save() instead
D. The variable name 'token' is reserved
Solution
Step 1: Check the response JSON fields
If the response JSON does not have a 'token' field, jsonData.token will be undefined.
Step 2: Understand saving undefined values
Saving undefined means the environment variable 'token' will not be set correctly.
Final Answer:
The response does not contain a 'token' field -> Option A
Quick Check:
Missing field = no saved value [OK]
Hint: Check response fields before saving variables [OK]
Common Mistakes:
Thinking pm.environment.set() is invalid
Using non-existent pm.response.save()
Assuming variable names are reserved
5. You want to save the 'sessionId' from a nested JSON response: