jmeter学习指南之中文乱码

视频地址:http://edu.51cto.com/lecturer/4626073.html


有时候在发送请求/查看响应数据时,服务端接收到的请求中包含乱码,导致无法解析报错,解决方法有如下几种:


1、请求数据显示乱码
可以在请求中设置编码为 UTF-8 ,如下设置:
jmeter学习指南之中文乱码

2、返回数据包含乱码
2.1 修改 jmeter.properties
可以修改 jmeter.properties 文件中的 sampleresult.default.encoding 属性,改为 utf-8,如下:
jmeter学习指南之中文乱码

2.2 使用 beanshell
添加一个BeanShell PreProcessor,然后在 Script 代码区域添加:prev.setDataEncoding("utf-8");