当前位置:网站首页>Jmeter combat | Repeated and concurrently grabbing red envelopes with the same user
Jmeter combat | Repeated and concurrently grabbing red envelopes with the same user
2022-08-01 21:16:00 【love coriander】
Before we have written about Jmeter multiple people grab a red envelope concurrently, today we will write another scenario, the same user repeated and concurrently grab red envelopes multiple times, the two scenarios are still not the same, both are more suitable for the actual use of the userScenario, if a user can repeatedly receive two red envelopes under certain conditions, it must be a serious loophole. There are two situations here, one is interval repeated redemption, and the other is concurrent repeatreceive.Of course, the first one generally does not appear, and the interface will be limited; the second one is a more common problem, which needs to be locked to prevent repeated receipts caused by concurrent operations, and the front end also needs to perform anti-resubmission operations, which is safer.
1. Add the setup pre-thread group, set the number of threads to 1, in order to allow the same user to log in only once

Second, place the login interface in the one-time controller to ensure that the login interface is executed only once

Three, configure the login interface, the parameters are generally passed in the message body

Fourth, the login is successful, you can see the token value, you can configure the extraction token extractor

Five, configure the Json extractor to extract the token value

6. Add a beanshell post-processor after the extractor, configure the variable value in the extractor in the parameters, and set the extracted token value as a global variable KaTeX parse error:Expected group after '_' at position 2: {_̲_setProperty(re…{Token},)};

Seven, add a concurrent thread group, configure the number of threads to 21

8. Configure the request header under the thread group and pass in the global variable token (${__property(requestToken)})

Ninth, in business operations, red envelopes are issued, the number of red envelopes is 6, each 0.01, the database generates red envelope numbers, and configures the interface for grabbing red envelopes

10. Execute the concurrent thread group. It is found that only 1 interface is successfully grabbed, and the other 20 are all busy. Please do not click repeatedly!The description is a reminder of the locked report, which does not cause the problem of concurrent receipt by the same person.


Twelve, we set the thread group to loop twice

Thirteen, a fixed timer has been added, and it can be claimed twice in a loop, indicating that you have already claimed it, and you cannot claim it again!, the description is also normal, there is no problem of repeated collection

Now I invite you to join our software testing learning exchange group: [746506216], note "join the group", everyone can join togetherDiscuss and communicate software testing, learn software testing techniques, interviews and other aspects of software testing together. There will also be free live classes to gain more testing skills. Let's advance Python automated testing/test development together and move towards a high-paying careerroad.
Friends who like software testing, if my blog is helpful to you, if you like my blog content, please "Like", "Comment" and "Favorite" with one click!
边栏推荐
- 【微信小程序】【AR】threejs-miniprogram 安装(76/100)
- 封装一个管理 url 状态的 hook
- 记录第一次给开源项目提 PR
- How to encapsulate the cookie/localStorage sessionStorage hook?
- 关于Request复用的那点破事儿。研究明白了,给你汇报一下。
- 网红驼背矫正产品真的管用吗?如何预防驼背?医生说要这样做
- C Expert Programming Chapter 1 C: Through the Fog of Time and Space 1.4 K&R C
- CS-NP白蛋白包覆壳聚糖纳米颗粒/人血清白蛋白-磷酸钙纳米颗粒无机复合材料
- 附录A printf、varargs与stdarg A.1 printf函数族
- 和我一起写一个音乐播放器,听一首最伟大的作品
猜你喜欢

用户量大,Redis没法缓存响应,数据库宕机?如何排查解决?

响应式织梦模板清洁服务类网站

LeetCode·每日一题·1374.生成每种字符都是奇数个的字符串·模拟

测试开发人均年薪30w+?软件测试工程师如何进阶拿到高薪?

Jmeter实战 | 同用户重复并发多次抢红包

Realize the superposition display analysis of DWG drawing with CAD in Cesium

ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!

2022年秋招,软件测试开发最全面试攻略,吃透16个技术栈

2022牛客多校联赛第五场 题解

C Expert Programming Preface
随机推荐
Pytorch学习记录(八):生成对抗网络GAN
位运算简介
使用员工管理软件,解锁人力生产力新水平,提高人力资源团队灵活性
LeetCode
C专家编程 序
R语言 线性回归的有关方法
C Pitfalls and Defects Chapter 5 Library Functions 5.5 Library Function Signal
Realize the superposition display analysis of DWG drawing with CAD in Cesium
C Pitfalls and Defects Chapter 7 Portability Defects 7.11 An Example of a Portability Problem
图的邻接矩阵存储
JSD - 2204 - Knife4j framework - processing - Day07 response results
R语言 pca主成分分析的主要方法
牛血清白蛋白-葡聚糖-叶黄素纳米颗粒/半乳糖白蛋白磁性阿霉素纳米粒的制备
Hiking, cured my mental internal friction
C Expert Programming Preface
C陷阱与缺陷 第8章 建议与答案 8.2 答案
C语言_联合体共用体引入
C陷阱与缺陷 第8章 建议与答案 8.1 建议
牛血清白蛋白刺槐豆胶壳聚糖缓释纳米微球/多西紫杉醇的纳米微球DTX-DHA-BSA-NPs
Questions I don't know in database kernel interview(1)