业务压测需求:
查询和上报接口,
1.查询接口返回的数据有好几条需要上报的数据
2.查询接口中返回的每条数据中,有两个字段需要传递到上报接口
3.查询接口中,这两个字段一个为int型,一个为数组[1,2,3,4]
实现方式
1.获取查询接口的返回:
使用json提取器提取这两个字段:$.data.actionMsgList[*].actionMsgType ,如下图

2.使用if控制器,防止压测数据不存在
{__jexl3("{actionMsgTypes}" != "" and "${actionMsgTypes}" != null)}
if控制器:

3.使用循环控制器 ${actionMsgIds_matchNr} :

4.使用计数器,index记录每次循环的角标,reset这里一定要勾上:

5.使用beanshell处理器,将两个字段赋值给上报接口的变量

5.上报接口引用变量,不能使用""格式。
