标签:dwr shell get fstream sid dsc str new mat
1. 首先用一个请求,获取list数据;并且提取出来
这里获取出来的是48个Name,id,color
2. 使用beanshell取样器,循环次数 == ${goodsName_matchNr};可以从debug sample中查看
FileWriter fstream = new FileWriter("/jmeter/src/datacsv/goodsInfofor",true); BufferedWriter out = new BufferedWriter(fstream); //log.info(vars.get("goodsName_${__counter(true,)}").replace(" ","-"));for(int i=1; i<${goodsName_matchNr}+1; i++){ goodsName_i = "goodsName_"+i; // log.info(goodsName_i); String goodsName = vars.get(goodsName_i).replace(" ","-"); goodsId_i = "goodsId_"+i; String goodsId = vars.get(goodsId_i); goodsColorId_i = "goodsColorId_"+i; String goodsColorId = vars.get(goodsColorId_i); goodsColorName_i = "goodsColorName_"+i; String goodsColorName = vars.get(goodsColorName_i); // log.info(goodsName); out.write(goodsName+","+goodsId+","+goodsColorId+","+goodsColorName+"\n"); } out.close(); fstream.close();
jmeter-beanshell本地文件写入多列数据--for循环
标签:dwr shell get fstream sid dsc str new mat
原文地址:https://www.cnblogs.com/nieliangcai/p/13208628.html