Jmeter线程配置
${__P(threadCount,1)}
${__P(rampUp,1)}
${__P(durationTime,1)}
Jmeter命令行执行
sh jmeter.sh -JthreadCount=1 -JrampUp=10 -JdurationTime=3 -n -t IDC_XX.jmx -l test.jtl
Jmeter自带json解析方法
import com.alibaba.fastjson.JSONObject;
String rsp=prev.getResponseDataAsString();//关键
JSONObject jsonObject=JSONObject.parseObject(rsp);
String authToken=jsonObject.getString("authToken");
String userId=jsonObject.getString("userId");
vars.put("authToken",authToken);
vars.put("userId",userId);