Badboy是什么?
Badboy是辅助自动化测试的工具,用于录制自动化测试脚本,通过简单地点击操作记录操作步骤,导出Jmeter文件,用于Jmeter测试使用。
一、Badboy下载安装
1、官网下载安装文件,直接安装。官方网址:http://www.badboy.com.au/
2、双木的网盘安装包:链接:https://pan.baidu.com/s/1HNF2RZ-lA3SfVvHlpl2w5A提取码:tim3
二、基本使用方法
1、如何录制脚本,输出Jmeter文件,并利用Jmeter使用脚本
启动Badboy,你可以看到下面的界面在地址栏中输入你需要录制的Web应用的URL——http://loaclhost:8080 这就是项目路径,
点击 开始录制 按钮(图中蓝色圆圈标注的部分)开始录制
开始录制后,你可以直接在Badboy内嵌的浏览器(主界面的右侧)中对被测应用进行操作,所有的操作都会被记录在主界面左侧的编辑窗口中(图中黄色方框标 注的部分)——在这个试验中,不过录制下来的脚本并不是一行行的代码,而是一个个Web对象——这有点像LoadRunner的VuGen中的Tree View视图
录制完成后,点击工具栏中的“停止录制”按钮(图中紫色方框标注的部分),完成脚本的录制。选择“File -> Export to JMeter”菜单,填写文件名“tongyizhifu.jmx”,将录制好脚本导出为JMeter脚本格式。
脚本另存为
保存的是bx,需要另存为jemeter,接着另存为1218rycK_1993
打开存的脚本
加一个结果树
做认证、设置cookie4
参数化:设置变量名+变量值
1)设置变量
2)复用该变量
3)设置请求头
循环控制器
设置循环次数
2、Badboy常用快捷方式:
F2 Toggles Record Mode On/Off
F3 Displays the search/replace dialog, or searches if the dialog is already open.
Ctrl-Alt-Right Starts playing from the current item.
Ctrl-Alt-Space Stops Playing
Ctrl+F5 Plays entire hierarchy from the current item. (Note: if focus is inside the browser, IE will intercept as "Refresh").
F6 Single steps (plays next single item in script.)
F8 Shows/Hides Script Tree
F9 Shows/Hides Summary Tab View
F12 Shows/Hides both Script and Summary Views together (gives browser full window space)
Ctrl+Enter Replays the item current item in the script
Ctrl+Shift+Enter Replays the current step in the script
Ctrl+Shift+Left Rewinds the play marker to the previous step.
Ctrl+Alt+Up Moves the play marker to the previous item in script.
Ctrl+Alt+Down Moves the play marker to the previous item in script.
Ctrl+L Displays the lines Server Log File related to the most recent browsing activity.
Ctrl+K Clears all responses from the Script.
Ctrl+J Attempts to find and edit the source code file for the current page and/or frame that has focus in the browser.
Ctrl+Shift+J Attempts to find and edit the source code file for the current page and/or frame that has focus in the browser and also adds the URL for the frame to your script as a Monitored request.
Ctrl+Shift+M Adds URLs for all frames in the current browser as Monitored requests.
Ctrl+D Toggles DOM View On/Off for the active window.
Ctrl+Page Up While in DOM View changes to previous frame in frame list
Ctrl+Page Down While in DOM View changes to next frame in frame list
Ctrl+Alt Changes Record Mode temporarily to Navigation Mode while held down
Ctrl+Alt+N Toggles record mode between Navigation and Request mode
Ctrl+Shift+D Opens the documentation editor for the item currently selected in the Script Tree.