网址
https://jmeter.apache.org/
下载

自行检查环境变量 path是否配置,Jmeter运行依赖
步骤略
运行

成功运行会启动JMeter GUI工具
设置语言(可选)
选择Options --> Choose Language --> Chinese(Simplified),设置语言为中文简体
基本使用
1.选择TestPlan,右键-->添加-->线程-->线程组

2.线程组内容如下,无特殊需求,直接默认即可

3.请求添加, 选择线程组,右键-->添加-->取样器

不仅支持http 还支持tcp ,此时我选择了tcp
4.选择线程组,右键-->添加-->监听器-->查看结果树

5.执行测试

6.查看结果

通过jmeter和服务端可以看到 数据成功传输。
作者:程序员潇然 疯狂的字节X https://crazybytex.com/
问题
上图可以看到中文乱码了,项目中的设置是没有问题的,那就只能是Jmeter的设置有问题了
看下配置文件
jmeter.properties
可以找到,default to Platform defaults charset as returned by Charset.defaultCharset().name() 如果不设置按照平台默认的

所以指定一下
tcp.charset=UTF-8
重启Jmeter,然后重试查看结果:

转载务必注明出处:程序员潇然,疯狂的字节X,https://www.crazybytex.com/thread-13-1-1.html
|