🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Postman: all 10 questions

Quiz: Postman · Question 1 of 10

Which line saves the login token for later requests in a Postman test script?

Which line saves the login token for later requests in a Postman test script?

  1. A.pm.test('token')
  2. B.pm.collectionVariables.set('token', pm.response.json().token)
  3. C.console.log(token)
  4. D.pm.response.to.have.token()
Answer & explanation

Correct answer: pm.collectionVariables.set('token', pm.response.json().token)

Later requests use it as {{token}}.

Can you get the rest right without peeking?

Take the timed Quiz: Postman quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →