其他分享
首页 > 其他分享> > jemter 随机取数组里面的值放入请求

jemter 随机取数组里面的值放入请求

作者:互联网

使用前置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}",
}

标签:province,index,district,vars,city,数组,put,jemter,放入
来源: https://www.cnblogs.com/kaibindirver/p/14957104.html