anuj jain
anuj jain

Reputation: 11

Unable to Set Initial Value for access_token and token_expiry Variables from Pre-request Script when Running Postman Collection via CLI

I'm running into an issue with my Postman setup when executing collections through the Postman CLI . Specifically, I'm trying to dynamically set the access_token and token_expiry variables from a pre-request script before each request.

But it works fine while using running collection from postman GUI.

below ones are tried, but unable to resolve

pm.variables.set("access_token", newToken);
pm.variables.set("token_expiry", newExpiryTime);

and

pm.collectionVariables.set("access_token", newToken);
pm.collectionVariables.set("token_expiry", newExpiryTime);

Upvotes: 1

Views: 28

Answers (0)

Related Questions