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());
------------------------- A little Progress a day makes you a big success... ----------------------------