Check_Point
156-521 · Question #186
What should be added in Postman's "Tests" tab after a login request to capture the session token?
The correct answer is C. pm.environment.set("session", pm.response.json().sid). The correct script is pm.environment.set("session", pm.response.json().sid);, which extracts the session token from the response and stores it as a reusable environment variable.
Security Management API Operations
Question
What should be added in Postman's "Tests" tab after a login request to capture the session token?
Options
- Aconsole.log("token");
- Bvar token = request.token
- Cpm.environment.set("session", pm.response.json().sid);
- Dpostman.setGlobal("token", true);
How the community answered
(29 responses)- A7% (2)
- B3% (1)
- C76% (22)
- D14% (4)
Explanation
The correct script is pm.environment.set("session", pm.response.json().sid);, which extracts the session token from the response and stores it as a reusable environment variable.
Topics
#Postman test scripts#session capture#pm.environment.set#sid
Community Discussion
No community discussion yet for this question.