当响应数据或响应页面没有设置编码时,jmeter会按照jmeter.properties文件中,sampleresult.default.encoding设置的格式解析

默认ISO-8859-1,解析中文肯定出错

 
  1. # The encoding to be used if none is provided (default ISO-8859-1)  
  2. #sampleresult.default.encoding=ISO-8859-1  


例子:某请求响应数据编码为UTF-8,通过“查看结果树”看到响应数据为乱码;

 

方案一:直接修改sampleresult.default.encoding=UTF-8。(记住去掉#,不要还是注释状态哦)

方案二:动态修改(这种方法方便些,蜗牛推荐)

   step1:指定请求节点下,新建后置控制器"BeanShell PostProcessor"

   step2:其脚本框中输入:prev.setDataEncoding("UTF-8");

   step3:保存

 

jmeter响应结果乱码问题

 

相关文章:

  • 2021-09-29
  • 2022-12-23
  • 2021-12-11
  • 2021-06-20
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
猜你喜欢
  • 2021-09-21
  • 2022-01-15
  • 2021-06-27
相关资源
相似解决方案