当前位置:网站首页>使用JMeter录制脚本并调试
使用JMeter录制脚本并调试
2022-07-05 17:59:00 【咖猫】
第一步:在JMeter中添加线程组,命名为AddBugByJMeter
第二步:在线程组下添加HTTP请求默认值
添加->配置元件->HTTP请求默认值,设置服务器IP和端口号(JMeter默认使用80端口号,我的禅道配置的是81端口)
第三步:添加HTTP代理服务器
1、添加非测试原件->HTTP代理服务器,并设置端口号(可以通过netstat -ano查看电脑中未使用的端口号)、选择目标控制器(选中前面的线程组)

2、点击HTTP代理服务器的启动按钮,启动后可以通过JMeter右上角的log查看按钮查看启动情况

3、打开Google Chrome浏览器设置代理

第四步:开始录制
1、用Google Chrome浏览器访问禅道主页,可以看到打开首页时JMeter就已经记录下对应的请求信息了。
2、继续录制完成添加bug的业务,完成后退出禅道管理系统,回到登录页面。
3、录制完成后取消浏览器的本地代理设置。
4、查看JMeter的录制情况,可以看到录制的内容特别多,其中有很多png、css、gif、js等请求信息.
在这里插入图片描述
5、通过HTTP代理服务器的排除模式,排除一些不需要的请求信息,如css、gif、png等等。
在这里插入图片描述
6、设置包含和排除模式后删除原来录制的请求,重新进行录制(可以在HTTP代理服务器下添加监听器->查看结果树来查看录制情况)。
第四步:调试脚本
我的脚本录制中有两个请求录制成功,但是回放失败,从请求信息中看到请求的服务器为api.zentao.net,其他请求都是127.0.0.1。因为不知道是什么,也不知道会不会对回放造成影响,所以我的做法是先禁用这两个请求,再继续调试。
在这里插入图片描述
第五步:在线程组下面添加察看结果树和聚合报告查看回放的情况。
1、从察看结果树中看到回放全部通过。
2、登录禅道系统查看是否真正添加成功(结果为失败,bug列表中并没有新增的bug)。
3、在查看结果树中通过HTML形式对每个请求进行排查。
4、为了测试结果更加直观,可以修改脚本中提前的bug名称,这里改成了Replay
在这里插入图片描述
5、回放成功后查看禅道管理器中是否添加成功。
在这里插入图片描述
总结
问题1: JMeter使用IE浏览器失败
问题现像: 录制结果中没有HTTP请求信息,只有第四步被禁用的那2条
问题分析:怀疑是浏览器自身的问题或者设置问题,未能解决,所以换成了Google Chrome
原文:https://www.cnblogs.com/tester808/p/6619129.html
此种方式的原理是利用代理记录浏览器的访问记录。录制脚本的另一种方式则是使用badboy。
边栏推荐
- GIMP 2.10教程「建议收藏」
- 生词生词生词生词[2]
- Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
- Cmake tutorial Step4 (installation and testing)
- Sophon base 3.1 launched mlops function to provide wings for the operation of enterprise AI capabilities
- Zabbix
- Tkinter window preload
- Unicode processing in response of flash interface
- Can communication of nano
- GFS distributed file system
猜你喜欢

Huaxia Fund: sharing of practical achievements of digital transformation in the fund industry

IDC report: Tencent cloud database ranks top 2 in the relational database market!

What are the changes in the 2022 PMP Exam?

buuctf-pwn write-ups (9)

Sophon AutoCV:助力AI工业化生产,实现视觉智能感知

How awesome is the architecture of "12306"?

EPM related
![含重复元素取不重复子集[如何取子集?如何去重?]](/img/b2/d019c3f0b85a6c0d334a092fa6c23c.png)
含重复元素取不重复子集[如何取子集?如何去重?]
![[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business](/img/a6/aa0b8d30913dc64f3c0cd891528c40.png)
[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business

“12306” 的架构到底有多牛逼?
随机推荐
吳恩達團隊2022機器學習課程,來啦
Use of print function in MATLAB
【在优麒麟上使用Electron开发桌面应】
图扑软件数字孪生 | 基于 BIM 技术的可视化管理系统
Unicode processing in response of flash interface
IDC report: Tencent cloud database ranks top 2 in the relational database market!
Crontab 日志:如何记录我的 Cron 脚本的输出
在一台服务器上部署多个EasyCVR出现报错“Press any to exit”,如何解决?
《力扣刷题计划》复制带随机指针的链表
Tkinter window preload
VC编程入门浅谈「建议收藏」
检查命名空间和类
LeetCode 练习——206. 反转链表
[JMeter] advanced writing method of JMeter script: all variables, parameters (parameters can be configured by Jenkins), functions, etc. in the interface automation script realize the complete business
从XML架构生成类
GFS分布式文件系统
彻底理解为什么网络 I/O 会被阻塞?
Teamcenter 消息注册前操作或後操作
Neural network self cognition model
删除数组中的某几个元素