当前位置:网站首页>Postman association to complete interface automation test

Postman association to complete interface automation test

2022-06-21 17:54:00 cae_ 520_ ww

Create two basic interfaces , One generates the request parameters of another , for example : Create the generated by the active interface ID, Request parameters to be used to withdraw approval activities , How to achieve , We all know the connection ,postman How to do Association

jmeter The created parameters should be placed in the request header or public parameter list , So that other interfaces can reference , that postman Some differences , But the difference is not great ,postman Is to store parameters in global variables , Here's the picture :

(1) In the request to create parameters test plate , Write and set parameter names , Function to get parameter value ,data Is the value of the parameter we want in the response body

// Get parameters and write them to global variables 
var result = JSON.parse(responseBody);
postman.setEnvironmentVariable("activity_ID", result.data);

(2) After execution , View environment variables , Parameters and parameter values are automatically generated

(3) Go to the interface where we want to reference parameters , Just quote

  comprehensive , It's done. postman The associated function of , With some automation , Click on runner Get into A new popup page , Select the corresponding file directory , Relevant configuration can complete

 

Then we'll talk about it in detail next time , But first, let me say , Pressure measurement and automation can be done here

原网站

版权声明
本文为[cae_ 520_ ww]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211610549378.html