当响应数据或响应页面没有设置编码时,jmeter会按照jmeter.properties文件中,sampleresult.default.encoding设置默认ISO-8859-1格式解析,解析中文肯定出错。
1 | # The encoding to be used if none is provided (default ISO-8859-1) |
直接修改sampleresult.default.encoding=UTF-8。
1:指定请求节点下,新建后置控制器BeanShell PostProcessor。
2:其脚本框中输入:prev.setDataEncoding("UTF-8")。
3:保存。
