//获取token
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONArray;
import java.util.*;
import org.apache.jmeter.util.JMeterUtils;
//获取可上机机器
String response = prev.getResponseDataAsString();
JSONObject responseObect = JSONObject.parseObject(response);
token = responseObect.getString(“token”);
log.info(“=====================”+token);
JMeterUtils.setProperty(“MY_GLOBAL_TOKEN”, token);
获取:
${__P(MY_GLOBAL_TOKEN,)}