In interface testing, we often encounter the response information of the previous request as the input parameter of the next request , This is it. Dynamic parameter association ,postman How does this tool achieve dynamic parameter correlation ?
First , Add environment
secondly , Assign the data to be dynamically correlated to an environment variable
Last , Reference this variable in the latter request
1、 Add environment information
choice Environments, Click on + Button to add a set of environments . Or click New Button , choice Environments To add a set of environments . According to the needs of actual test , Check the environment , Make it your current work environment .
2、 Assign the data to be dynamically correlated to an environment variable
In the previous request Tests Tab , The data that needs to be passed to the next request , Assign to an environment variable . See attached figure .
3、 Reference this variable in the latter request
In the latter request , Can pass {{ids0}} The environment variable is referenced in the form of double curly braces .
After executing these two requests separately , The expected effect can be achieved .postman It also provides a method of batch execution , The following will be introduced one by one