录制脚本的配置
1、打开JMeter,新建压测脚本,添加“HTTP(S) Test Script Recorder”
2、添加“Threads Group”
3、在Thread Group中添加“Recording Controller”
4、配置HTTP(S) Test Script Recorder
设置port=8088,设置Target Controller=Test Plan>Tread Group>Recording Controller
5、点击保存脚本
6、浏览器设置
打开火狐浏览器的首选项,网络设置,点击设置按钮,选中手动代理设置
7、点击start按钮,然后操作浏览器
8、也可以增加过滤条件和移除条件(移除静态资源)
![](https://i-blog.csdnimg.cn/blog_migrate/c7cb058a6b9709ec8f4c27c7b31b3347.jpeg)
保存后再次start
![](https://i-blog.csdnimg.cn/blog_migrate/9617c4a5c5bc5358f40295f036ccf2f6.png)
9、添加Result Tree回放验证
![](https://i-blog.csdnimg.cn/blog_migrate/9eee13205bed5a7427b5efeeee9a35cb.png)
点击start按钮
![](https://i-blog.csdnimg.cn/blog_migrate/da08a661fa1c58f8afd9ae09f86147ba.jpeg)
10、添加响应断言
右键单击对应的Http Request,添加ResponseAssertion
设置Field和Matching Rules,以及Patterns to Test,再次运行View Result Tree
11、添加聚合压测报告