loadrunner11重播日志中服务器的中文日志显示混乱

时间:2018-07-23 08:42:15

标签: testing loadrunner

我使用Loadrunner在Java Vuser中编写一个HTTP请求脚本。然后我使用web.reg_save_param()接收响应。但是,“重播日志”中的响应日志显示出混乱情况。我不知道如何解决它。日志如下:

`Notify: Saving Parameter "resp = HTTP/1.1 200 OK\r\nServer: Apache- 
Coyote/x.xx\r\nContent-Type: text/html;charset=UTF-8\r\nTransfer-Encoding: 
chunked\r\nVary: Accept-Encoding\r\nDate: Mon, 23 Jul 2018 07:50:03 
GMT\r\nConnection: close\r\n\r\n{"charset":"utf- 
8","Id":"xxxxxx","Type":"0","respCode":"xxxxx",
"respDesc":"鏌ヨ璁㈠崟鎴愬姛","FinishTime":"2018xxxxx",
"RespCode":"OK","RespDesc":"浜ゆ槗鎴愬 
姛","State":"02"}".`

1 个答案:

答案 0 :(得分:0)

保存响应日志后,我已用代码String r = new String(m.getBytes("GBK"),"UTF-8");解决了该问题,然后可以打印正确的日志。