Q:Jmeter 得到的response里的中文部分是乱码。
A:改encoding方式为UTF-8。
Solution1: UI方式启动Jmeter,在 HTTP Request Sampler的“Content encoding”栏中填入utf-8.
Solution2: 打开apache-jmeter-*/bin/jmeter.properties, 搜索“sampleresult.default.encoding”,取消注释,改成UTF-8。
sampleresult.default.encoding=UTF-8
保存,重启jmeter即可。
Solution3: UI方式启动Jmeter,Thread Group 右键添加Post Processor,选择BeanShell PreProcessor。在Script里写:
prev.setDataEncoding("utf-8")