在jmeter 发送请求过程中,有时候后台返回的是unicode 代码,如:
{"status":-1,"msg":"\u63d0\u4ea4\u6570\u636e\u4e0d\u8db3"}
手动转换成中文为:
{"status":-1,"msg":"提交数据不足"}
需要使用jmeter 把响应内容转换成中文显示,方便查看。思路是使用bean shell 把unicode响应结果转换成中文,步骤为:
1、右键点击请求,添加后置处理器,BeanShell PostProcessor
2、在BeanShell PostProcessor(bean shell脚本语法和用法和java一致)设置脚本为:
private static String ascii2native ( String asciicode ) { String[]