JMeter解决接口返回数据乱码问题

借鉴网址

https://www.jianshu.com/p/05131614093b

解决方法

1:在线程组http请求里面直接写编码:utf-8

2:对于上面1的解决不了的就需要改jmeter的配置文件,在jmeter.properties中,sampleresult.default.encoding修改为sampleresult.default.encoding=UTF-8,重启jmeter

3:如果改文件不行的话,遇到乱码,在线程组添加后置处理器BeanShell PostPrecessor写入代码:

prev.setDataEncoding("utf-8");

重启jmeter

如果这三种都不行的话,那我也没有办法了,我自己是前两个无效,方法3起作用了。

原文地址:https://www.cnblogs.com/fengzhentian/p/13582099.html