Postman using the script variable assignment

scenes to be used:

       When we tested using an API Postman next API (B) of a parameter after a return value, we can set the variable current API (A) request, while using the current script API (A) Request the return value of a variable as a parameter and the value assigned to the set, is supplied to the next API (B) used.

script:

pm.test("Set TeamID", function () { var jsonData = pm.response.json(); pm.collectionVariables.set("TeamID", jsonData.participantKey); });

And methods of using the script assignment:

Gets the current API (A) request to return the key value participantKey, and the key is assigned TeamID variable.

TeamID had no value, the assignment provided to API (B) as a parameter:

 

 

 

 

 

 

 

 

 

 

 

 

Published 22 original articles · won praise 5 · Views 2197

Guess you like

Origin blog.csdn.net/calm_encode/article/details/103861840