当前位置:网站首页>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!
边栏推荐
猜你喜欢
随机推荐
PyQt5 + MySQL5.8 【学生信息管理系统】【增删改查】
使用员工管理软件,解锁人力生产力新水平,提高人力资源团队灵活性
30+的女性测试人面试经验分享
C陷阱与缺陷 第7章 可移植性缺陷 7.7 除法运算时发生的截断
C陷阱与缺陷 第8章 建议与答案 8.2 答案
织梦通过数据库查询调用当前文章的留言
Hiking, cured my mental internal friction
C语言_typedef和结构体
关键字搜索:“淘宝商品 API ”
磷酸化甘露糖苷修饰白蛋白纳米粒/卵白蛋白-葡聚糖纳米凝胶的
Transplant MQTT source code to STM32F407 development board
测试开发人均年薪30w+?软件测试工程师如何进阶拿到高薪?
C语言_枚举类型介绍
[译] 容器和 Kubernetes 中的退出码完整指南
C陷阱与缺陷 第5章 库函数 5.5 库函数signal
C语言之字符串函数二
网络安全与基础设施安全局(CISA):两国将在网络安全方面扩大合作
How to encapsulate the cookie/localStorage sessionStorage hook?
技能大赛训练:A部分加固题目
ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!