假设我们需要测试n个api,这些api的domain都是相同的,比如
如果有一天,api的domain变化了,不再是api.itest.info,那么就麻烦了
我们可以在builder里引用变量
{{variable}}
演示
https://www.v2ex.com/api/nodes/show.json?name=python
node_name:php/python/qna
演示
如何创建json格式的data
如何在postman中运行
演示:生成html报告
https://postman-echo.com/get?test=123
try{
responseJSON =JSON.parse(responseBody);
tests[‘response is valid JSON‘] = true;
}
catch (e) {
responseJSON = {};
tests[‘responser is valid JSON‘] = false;
}
tests[‘response json contains headers‘] = _.has(responseJSON,‘headers‘);
tests[‘response json contains args‘] = _.has(responseJSON,‘args‘);
tests[‘response json contains url‘] = _.has(responseJSON,‘url‘);
tests[‘args key contains argument passed as url parameter‘] = (‘test‘ in responseJSON.args);
原文:https://www.cnblogs.com/xinxin1994/p/11259283.html