(五)保存http接口响应数据

一、保存在jp@gc - JSON/YAML Path Extractor中

{
   "data" : [ //数组
      {//对象
         "id" : 0,
         "result" : 1,
         "seqno" : "1"
      }
   ],
   "error_code" : 1,
   "message" : "Success",
   "timestamp" : 1557225481
}
  • $.error_code
  • $.data[0].id

(数组:[index] 对象:.)

基本是这样写的,若获取不到数据,则要查看path写的是否正确

检查方法①使用Chrome扩展程序json handle

https://blog.csdn.net/hujyhfwfh2/article/details/80588512

检查方法②

 可以用debug Sampler查看变量值是否正确。

(即变量会保存在里面)

二、使用beanshell提取(提取对象、数组)BeanShell PostProcessor

posted @ 2019-06-10 19:32  测试开发分享站  阅读(189)  评论(0编辑  收藏  举报