系统相关
首页 > 系统相关> > jmeter-BeanShell

jmeter-BeanShell

作者:互联网

参考链接:https://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterContext.html

 

添加变量到jmeter

String n="hqj";
vars.put("n",n);

获取jmeter变量

String n =vars.get("n");

 接口响应信息

String str=prev.getResponseDataAsString();

 

 

 

 

String iresponse = new String(ResponseData,"UTF-8");//中文乱码处理
log.info("请求头:"+ResponseHeaders);
log.info("请求url+参数:"+SamplerData);
log.info("响应码:"+ResponseCode);
log.info("响应信息"+iresponse);

标签:info,log,vars,BeanShell,apache,jmeter,String
来源: https://www.cnblogs.com/zmxxw/p/16227585.html