case 一

http://{{variable_key}}/api/weather/city/101200101

 

 

 

 pre-Script

postman.clearEnvironmentVariable("variable_key");
postman.setEnvironmentVariable("variable_key", "t.weather.sojson.com");

 

Tests

var response = JSON.parse(responseBody);
console.log("response:"+response);

var status=response.status
console.log("status:"+status);
pm.environment.set("variable_key1", "不要说话");

 

 

case二

https://api.apiopen.top/searchMusic?name={{variable_key1}}

 

 pre-Script

 console.log(pm.environment.get("variable_key1"));

 

Tests

var response = JSON.parse(responseBody);

var author=response.result[0].author;
console.log("author:"+author);
 
 
 

 postman获取变量

 

 

 

 

md5加密

https://testerhome.com/topics/14400

 

相关文章:

  • 2021-04-10
  • 2021-07-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-26
  • 2022-03-09
  • 2022-12-23
猜你喜欢
  • 2021-08-04
  • 2022-12-23
  • 2021-07-27
  • 2021-10-24
  • 2021-08-16
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案