当前位置:网站首页>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!
边栏推荐
- Get started with Grafana in 15 minutes
- 附录A printf、varargs与stdarg A.2 使用varargs.h来实现可变参数列表
- 空间数据库开源路,超图+openGauss风起禹贡
- 【中文树库标记---CTB】
- 使用百度EasyDL实现厂区工人抽烟行为识别
- An online JVM FullGC made it impossible to sleep all night and completely crashed~
- C陷阱与缺陷 第7章 可移植性缺陷 7.9 大小写转换
- Hiking, cured my mental internal friction
- TP5-NPs负载噻吩类化合物TP5白蛋白纳米粒/阿魏酸钠新糖牛血清蛋白纳米粒
- 虚拟内存与物理内存之间的关系
猜你喜欢
随机推荐
C pitfalls and pitfalls Chapter 8 Suggestions and answers 8.2 Answers
Transplant MQTT source code to STM32F407 development board
C专家编程 第1章 C:穿越时空的迷雾 1.3 标准I/O库和C预处理器
如何让定时器在页面最小化的时候不执行?
记录第一次给开源项目提 PR
2022牛客多校联赛第五场 题解
15 分钟带你入门 Grafana
虚拟内存与物理内存之间的关系
R语言 pca主成分分析的主要方法
LeetCode·32.最长有效括号·栈·动态规划
ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!
附录A printf、varargs与stdarg A.1 printf函数族
2022年秋招,软件测试开发最全面试攻略,吃透16个技术栈
kubernetes各名词缩写
C语言之字符串函数二
[Chinese tree tags - CTB]
C陷阱与缺陷 附录B Koenig和Moo夫妇访谈
如何优雅的性能调优,分享一线大佬性能调优的心路历程
附录A printf、varargs与stdarg A.2 使用varargs.h来实现可变参数列表
移植MQTT源码到STM32F407开发板上









