当前位置:网站首页>【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试
【jmeter】jmeter脚本高级写法:接口自动化脚本内全部为变量,参数(参数可jenkins配置),函数等实现完整业务流测试
2022-07-05 16:27:00 【bulabula2022】
背景:
笔者在做接口/性能测试过程中,遇到需要大量造测试数据得场景,或者通过接口测试回归整个业务链路等,通过一点点积累,实现了jmeter脚本内无写死数据,全程都是变量,参数,函数实现想要得测试数据,做到一次编写,在任何测试环境配置基本的环境下即可使用的目标。现分享给大家,欢迎沟通交流
1、整体概览

2、 beanshell自动获取本地文件,自动新增用户,并初始化

用户新增脚本

3、初始化用户数据,初始化业务数据,登录token获取,并保存

token,user ,account等写入本地
4、造基础业务数据,java自动获取N天前N天后特定时间戳
脚本body体做到全部为参数,变量函数等,可应用到任何测试环境
json提取器,beanshell里编写java程序
5、 json格式数据JSONObject和JSONArray处理,java获取返回的动态数据,循环参数到下一步业务

循环次数动态获取

脚本中也使用到其它函数,如下
日期函数:
${__longSum(${__time},+86400000,)},
${__longSum(${__time},-86400000,)}
循环控制器:
${Name_#}
计数器:
starting value:1,
递增:1,
max value:${Name_#},
引用名:N,
参数化:${__V(Name_${N})}
边栏推荐
- npm安装
- What is ROM
- Domestic API management artifact used by the company
- [Jianzhi offer] 66 Build product array
- How to set the WiFi password of the router on the computer
- Data access - entityframework integration
- 面对新的挑战,成为更好的自己--进击的技术er
- [深度学习][原创]让yolov6-0.1.0支持yolov5的txt读取数据集模式
- Jarvis OJ Telnet Protocol
- 网站页面禁止复制内容 JS代码
猜你喜欢

Benji Bananas 会员通行证持有人第二季奖励活动更新一览

【机器人坐标系第一讲】

The first EMQ in China joined Amazon cloud technology's "startup acceleration - global partner network program"

Global Data Center released DC brain system, enabling intelligent operation and management through science and technology
![[61dctf]fm](/img/22/3e4e3f1679a27d8b905684bb709905.png)
[61dctf]fm

Jarvis OJ 远程登录协议

File operation --i/o

Android privacy sandbox developer preview 3: privacy, security and personalized experience

Detailed explanation of use scenarios and functions of polar coordinate sector diagram

Games101 notes (I)
随机推荐
Deep dive kotlin synergy (XXI): flow life cycle function
composer安装报错:No composer.lock file present.
JSON转MAP前后数据校验 -- 自定义UDF
C# TCP如何设置心跳数据包,才显得优雅呢?
NPM installation
关于new Map( )还有哪些是你不知道的
Data access - entityframework integration
ECU introduction
PHP 严格模式
What is the difference between EDI license and ICP business license
阈值同态加密在隐私计算中的应用:解读
数据访问 - EntityFramework集成
[brush questions] effective Sudoku
[Jianzhi offer] 61 Shunzi in playing cards
麻烦问下,DMS中使用Redis语法是以云数据库Redis社区版的命令为参考的嘛
Starkware: to build ZK "universe"
飞桨EasyDL实操范例:工业零件划痕自动识别
中国广电正式推出5G服务,中国移动赶紧推出免费服务挽留用户
The survey shows that the failure rate of traditional data security tools in the face of blackmail software attacks is as high as 60%
[brush title] goose factory shirt problem