使用前置beanshell
String[][] index = {{"广东省","深圳市","龙岗区"},{"浙江省","杭州市","滨江区"}};
int i=${__Random(0,1,)};
log.info(index[i][0]);
log.info(index[i][1]);
log.info(index[i][2]);
vars.put("province",index[i][0]);
vars.put("city",index[i][1]);
vars.put("district",index[i][2]);
请求体调用:
{
"age":"${__Random(1,99,)}",
"schoolName":"123",
"grade":"幼儿园小班",
"userClass":"2班",
"province":"${province}",
"city":"${city}",
"district":"${district}",
}