当前位置:网站首页>Postman loop calls the same interface

Postman loop calls the same interface

2022-05-14 14:00:58Fan Xi

Recently encountered such a scene : Only a single document can be cancelled on the page , But now a batch of documents need to be cancelled , Direct execution sql To update the document status, you need to update all related upstream and downstream documents at the same time , It's too troublesome , While using postman The circular call interface can be implemented to simulate the page call operation and batch documents . The operation is as follows :

1. Collections Create a new collection, Such as 【 Test loop call interface 】
2. collection Add the interface to be called , Such as 【 Cancel single order interface 】.

Note that the request parameters in this interface need to be written in variable form { {}}, Variable names can be used casually , The variable names here are id,reason
{ “id”:“{ {id}}”, “cancelReason”:“{ {reason}}” }
 Insert picture description here

3. Prepare the parameter file after the interface is written .

Build a local txt file , as follows , The first line is the variable name , The second line starts to write the specific value to be passed ,reason This variable is a string and needs double quotation marks .
use csv Files are ok , The same first line writes the variable name , The second line starts to write the value corresponding to the variable , Each column is a variable
 Insert picture description here

4. establish run perform . Click on collection Dexter ... Click on Run collection, Edit the relevant settings of the next cycle , Click on Run that will do . Here's the picture :

Iterations: Cycle a few times ( I cycle here 2 Time )
Delay: How long does each cycle delay execution ( Set the delay time according to your own situation )
Data: Parameter file address ( Select the parameter file created in the previous step )
Data File Type: Parameter file type ( My is text/csv)
 Insert picture description here
 Insert picture description here

原网站

版权声明
本文为[Fan Xi]所创,转载请带上原文链接,感谢
https://chowdera.com/2022/134/202205141343590865.html

随机推荐