Jmeter中BeanShell PostProcessor 将获取的列表中的,演出是销售的状态进行购买

import org.json.*;

 String avashowOID="";

        JSONArray ShowALLStatus = new JSONArray(vars.get("data"));

        for(int i=0;i<ShowALLStatus.length();i++){
            JSONObject aaa = new JSONObject(ShowALLStatus.get(i).toString());
            JSONObject bbb = new JSONObject(aaa.get("showStatus").toString());
            String ccc= bbb.get("name").toString();
            if(ccc.equals("ONSALE")){
                JSONObject json2 = aaa;
                avashowOID= json2.get("showId").toString();
                break;
            }
        }

vars.put("showid",avashowOID.toString());

  

猜你喜欢

转载自www.cnblogs.com/qianjinyan/p/12469280.html