Postman usage notes

Under normal circumstances, the execution order of Postman Runner is from top to bottom. If you need to change the execution order, you can use postman.setNextRequest

For example:
postman.setNextRequest(''); -- abort the process

postman.setNextRequest('request name'); -- set the next process


When an exception needs to be thrown, the following statement can be used:

Throwing an exception
pm.test("custom exception", function(){
        throw new Error('exception information');

});


When executing Postman Runner, if you need to obtain parameters from an external CSV file, the first line of the CSV file is the parameter key value. Iterate as many times as there are row parameters

When configuring environment variables, the key must be the same as the key in the file, and the corresponding value is data.[key]

When configuring Request, reference variables are still in the format of {{ key }}

Variables need to be referenced in the form of data.[key] in Tests


tests['xxx']=true | false Simple judgment statement

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326064237&siteId=291194637