Can I use environment variables set in a previous test in the payload I am posting?
eg.
POST /list
{
"some_key": environment.saved_value
}
Importing Postman Environments Click to open one of your Projects. Click the Vault tab. Click Variables. Click Import.
In the top right corner of Postman, click the environment selector and select Manage environments. Click Add to add a new environment where you'll define your OneLogin environment variables. Note: You'll need to use your API credentials to generate the access_token value.
Step1 − Click on the eye icon beside the No Environment dropdown and then click on the Edit link within the Globals section. Step2 − MANAGE ENVIRONMENTS pop-up opens up. Here, we have added the variable url and the value as https://www.tutorialspoint.com/index.htm. Click on Save then close the pop-up.
Yes, you can do that. You send it up like this
{
"some_key" : "{{environment_variable_name}}"
}
So, if in your previous test you had set it with something like
postman.setEnvironmentVariable("id","some_value")
You can use it in your POST with
{
"some_key" : "{{id}}"
}
Hopefully, that answers your question
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With