在查看响应的时候出现中文乱码的情况,这是因为JMeter默认使用的编码格式为ISO-8859-1,非UTF-8。
有两种方法可以,解决Http响应中文乱码问题:
1. 修改jmeter.properties
打开Jmeter安装目录/bin/jmeter.properties文件,修改#sampleresult.default.encoding=ISO-8859-1为 sampleresult.default.encoding=utf-8 (注意去掉开头的#注释),重启JMeter即可
2.添加BeanShell PostProcessor
选择Http请求,右键选择:添加 -> 后置处理器 -> BeanShell PostProcessor,在下方的Script中填入:prev.setDataEncoding(“UTF-8”);
再运行一次JMeter,可以看到中文已经可以正常显示了