import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
//String data = prev.getResponseDataAsString();
//print(data);
ArrayList idList = new ArrayList();
String responseData = prev.getResponseDataAsString();
log.info("这里的信息会保存在jmeter.log文件中,并打印显示在jmeter的实时运行日志");
//log.info(responseData);
JSONObject js = JSONObject.parseObject(responseData);
Object data1 = js.get("data");
JSONObject jss = JSONObject.parseObject(JSONObject.toJSONString(data1));
Object data2 = jss.get("list");
JSONArray jsonArray = JSONObject.parseArray(JSONObject.toJSONString(data2));
for (int i = 0; i < jsonArray.size(); i++) {
Object oo = jsonArray.get(i);
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(oo));
idList.add(jsonObject.getString("id"));
}
log.info(idList+"");
vars.put("newidList",idList+"")