1.添加正则表达式,提取所有id值
2.添加beanshell处理器将所有的id值拼接成字符串
方法一:
int N = Integer.parseInt(vars.get("build_matchNr")); log.info(N.toString()); List list = new ArrayList(); for(int i=1;i<=N;i++){ String dig = vars.get("build_"+i+"_g1"); log.info(dig); list.add(dig); } log.info(list.toString()); String id_data = String.join(",", list); vars.put("id_list", id_data);
方法二:
int N = Integer.parseInt(vars.get("build_matchNr")); log.info(N.toString()); String das = ""; for(int i=1;i<=N;i++){ String dig = vars.get("build_"+i+"_g1"); log.info(dig); das += dig + ","; } log.info(das); vars.put("id_list", das);
标签:提取,int,拼接,beanshell,id,处理器 From: https://www.cnblogs.com/mian-1122/p/16283571.html