当前位置:网站首页>【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})}
边栏推荐
- How was the middle table destroyed?
- npm安装
- Starkware: to build ZK "universe"
- 飞桨EasyDL实操范例:工业零件划痕自动识别
- 文件操作--I/O
- [wechat applet] read the life cycle and route jump of the applet
- 时间戳strtotime前一天或后一天的日期
- 數據訪問 - EntityFramework集成
- How does the outer disk futures platform distinguish formal security?
- Detailed explanation of use scenarios and functions of polar coordinate sector diagram
猜你喜欢

Jarvis OJ shell流量分析

Application of threshold homomorphic encryption in privacy Computing: Interpretation

How to set the WiFi password of the router on the computer

Jarvis OJ Telnet Protocol

WSL2.0安装

Flet tutorial 12 stack overlapping to build a basic introduction to graphic and text mixing (tutorial includes source code)

养不起真猫,就用代码吸猫 -Unity 粒子实现画猫咪
![[729. My schedule I]](/img/e3/32914227d00cf7595ee850e60f2b72.png)
[729. My schedule I]

Learnopongl notes (II) - Lighting

Pspnet | semantic segmentation and scene analysis
随机推荐
Jarvis OJ Webshell分析
[es6] add if judgment or ternary operator judgment in the template string
齐宣王典故
高数 | 旋转体体积计算方法汇总、二重积分计算旋转体体积
帮忙看看是什么问题可以吗?[ERROR] Could not execute SQL stateme
C how TCP restricts the access traffic of a single client
外盘期货平台如何辨别正规安全?
Excuse me, is the redis syntax used in DMS based on the commands of the redis community version of the cloud database
SQL injection of cisp-pte (Application of secondary injection)
【刷題篇】鹅廠文化衫問題
If you can't afford a real cat, you can use code to suck cats -unity particles to draw cats
浏览器渲染原理以及重排与重绘
如何安装mysql
Explain in detail the functions and underlying implementation logic of the groups sets statement in SQL
[brush title] goose factory shirt problem
Clear restore the scene 31 years ago, volcanic engine ultra clear repair beyond classic concert
Jarvis OJ Flag
【刷题篇】鹅厂文化衫问题
Keras crash Guide
飞桨EasyDL实操范例:工业零件划痕自动识别