-
提取接口的某个返回值,但这个值是Object类型,Like this:
错误做法:
var unNotice = jsonData.rows;
pm.environment.set("unNoticeItem", unNotice);
这样的结果就是:postman里unNoticeItem这个变量存的数据都是
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
- 正确做法:
var unNotice = jsonData.rows;
unNoticeItem = JSON.stringify(unNotice);
pm.environment.set("unNoticeItem", unNoticeItem);