視頻地址:http://edu.51cto.com/lecturer/4626073.html
有時候在發送請求/查看響應數據時,服務端接收到的請求中包含亂碼,導致無法解析報錯,解決方法有如下幾種:
1、請求數據顯示亂碼
可以在請求中設置編碼爲 UTF-8 ,如下設置:
2、返回數據包含亂碼
2.1 修改 jmeter.properties
可以修改 jmeter.properties 文件中的 sampleresult.default.encoding 屬性,改爲 utf-8,如下:
2.2 使用 beanshell
添加一個BeanShell PreProcessor,然後在 Script 代碼區域添加:prev.setDataEncoding("utf-8");