postman environment variables
pm.environment.set("variable_key", "variable_value");
postman environment variables
pm.environment.set("variable_key", "variable_value");
postman environment variables in body
{ "customer_id" : "{{cust_id}}" }
environment variable api
Environment Variable , a variable that accessible
only when the environment is active
Usually used for an app with multiple environment ,
we can use env variable to store variable with same name
and different value to store environment specific data
for example :
xxxNamed app has 3 environments with different
URL and Crendentials
But all endpoints are exactly the same no matter what
environment you work on
so we can create 3 environment called
QA1 , QA2 , QA3 and run same set of request
by selecting different environment.
Only one environment can be active at a time.
postman environment variable
postman.setGlobalVariable("refresh_token",postman.getResponseHeader("Refresh_token") );
Postman Variables
just like variables in Java.
we can create variables in postman to reuse the value
1.Global variables: accessible everywhere in same workspace
2.Environment variables: accessible in selected environment
3.Collection Variables: belong to the collection itself and
only accessible within the collection
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us