开发者社区> 问答> 正文

jmeterview results tree 中response data里面的中文乱码:配置报错

利用badboy录制我们公司网站的登录过程,导出为.jmx文件后在jmeter中运行,在view results tree中发现response data里面的中文乱码,sampler result中的dataEncoding :null。
尝试过的方法有如下2种(但是都无效):
1.jmeter.properties中sampleresult.default.encoding=UTF-8
2.http request中content encoding设为UTF-8

PS:尝试过录制其它网站(如126邮箱,360云盘),response data中中文显示正常。

展开
收起
kun坤 2020-06-02 14:59:25 805 0
1 条回答
写回答
取消 提交回答
  • 已解决,主要原因是自己的jmeter版本太老,使用的是前测试员下载的jmeter2.6,重新下载了jmeter2.11.同时修改并取消注释:jmeter.properties中
    The encoding to be used if none is provided(default UTF-8)
    sampleresult.default.encoding=UTF-8
    之前只有本公司网站中文乱码的原因是因为少了
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    而测试的其它网站都有
    <meta charset=utf-8>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
    听程序员说<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

     在HTML5中不需要,这么写只是为了兼容一些老的浏览器

    2020-06-02 15:39:00
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
How to Build a Successful Data 立即下载
Semantic Search--Fast Results from Large,Foreign Language Corpora 立即下载
The Value of Exploratory Data 立即下载