当前位置:网站首页>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!
边栏推荐
猜你喜欢
随机推荐
Day33 LeetCode
和我一起写一个音乐播放器,听一首最伟大的作品
响应式织梦模板美容整形类网站
在Cesium中实现与CAD的DWG图叠加显示分析
C陷阱与缺陷 附录B Koenig和Moo夫妇访谈
技术栈概览
C专家编程 第1章 C:穿越时空的迷雾 1.1 C语言的史前阶段
响应式织梦模板清洁服务类网站
TP5-NPs负载噻吩类化合物TP5白蛋白纳米粒/阿魏酸钠新糖牛血清蛋白纳米粒
SkiaSharp 之 WPF 自绘 五环弹动球(案例版)
MySQL Syntax Basics
Popular explanation: what is a clinical prediction model
JVM内存结构详解
JS Improvement: Handwritten Publish Subscriber Model (Xiaobai)
C语言_typedef和结构体
漏洞分析丨HEVD-0x6.UninitializedStackVariable[win7x86]
ISC2022 HackingClub white hat summit countdown 1 day!Most comprehensive agenda formally announced!Yuan universe, wonderful!
C陷阱与缺陷 第8章 建议与答案 8.1 建议
正则表达式
LeetCode·每日一题·1374.生成每种字符都是奇数个的字符串·模拟








