当前位置:网站首页>The company has only one test, but the leader asked me to operate 1000 mobile numbers at the same time
The company has only one test, but the leader asked me to operate 1000 mobile numbers at the same time
2022-06-23 14:10:00 【Software testing】

A lot now APP Or websites need to log in with a mobile number , When logging in with your mobile number , It is necessary to “ cell-phone number + SMS verification code ” Before you can log in successfully .
During the actual test , Testers usually have only one mobile phone number , Then you need to test multiple mobile phone numbers to get the information you need to log in through the SMS interface service “ SMS verification code ”, So how to solve the problem of multiple mobile phone numbers ?
- Collect the personal mobile phone numbers of other colleagues in the company
- Use Jmeter Provide random function , Generate the middle four digits of the mobile phone number
This paper focuses on the interface function of obtaining SMS verification code , Therefore, there is no need to check the format of each number segment of the mobile phone number , So choose the second one above “ use Jmeter The random number + Fixed number ” that will do . If you need a more realistic simulation ( For example, check whether the mobile phone number is legal, etc ), Other methods can be used to generate 11 Cell phone number , For example, generate legal mobile phone numbers through regular expressions .
01 Interface Analysis
Before starting an interface test or interface stress test task , You need to obtain the following relevant information from the interface documents provided by the development :
domain name (IP)
Address (path)
Request mode (post/get)
Enter the reference : Mobile phone number and other information
…
This article focuses on “ How to use Jmeter The random number generated by the random function of ” Combine into different mobile phone numbers , In order to pass “ Get SMS verification code ” The interface obtains the verification code required for login .
02 utilize Jmeter Generate four bit random number
utilize Jmeter The random function of _Random, Four digit random numbers can be generated :
choice Jmeter Self contained random function
Define the minimum value of a four digit random number
Define the maximum value of a four digit random number
Finally, the random function expression is generated :${__Random(0000,9999,)}

03 Splice phone numbers
Use random functions and fixed numbers to form a mobile phone number , The domestic mobile phone number is 11 position :
Top three :152( This article is an example of the fixed number segment of mobile phone number )
The middle four : Use random function expressions “${__Random(0000,9999,)}”
The last four :5208( This article is an example of a mobile phone number with a fixed tail number )
Joining together the results :152XXXX5208, In the middle of it “XXXX” Represents a four digit random number .
Sum up , The mobile phone number of the SMS interface "mobile":
"152${__Random(0000,9999,)}5208"
04 Simulate SMS interface request
Menu path :
stay Thread Group Right click —sample-HTTP Request
JMeter add to HTTP Request Configure the domain name requested by the interface 、 route 、 Request mode 、 Enter the level , Here's the picture :

05 Add listening tree
Menu path :
stay Thread Group Right click - lisener - View Results Tree

The listening tree report configuration remains the default configuration ( All request logs are displayed by default ) that will do , If you need to simulate 1000 Or more , You can choose to display only the error log :

06 Set the number of script runs
If you need to simulate 1000 Concurrent users , It can be set as follows :
Number of threads(users):1000
Ramp-up period(in seconds):0
Loop Count:1
The above configuration indicates 1000 Multiple users initiate to obtain the verification code at the same time , And each user executes .

If interval is required 1s In order to 1000 Users send SMS verification code , You need to set... On the thread group Loop Count=1000

07 Running results
Because... Is set on the thread group Loop Count=1000, So the script runs 1000 Time , Each time, the random function will generate a random four digit number and a fixed number, which will be spliced into different mobile phone numbers .
The running result of the script is shown in the figure below :
Click each request to see that the participating mobile phone numbers are different

Mobile number login process :
Use your mobile number to get the verification code
Use cell phone number + Login with verification code
This paper implements the first stage of the login process ~, If you need to log in at the same time , The login interface request can be added after obtaining the verification code .
Tips:
During the test , The test environment generally needs to add SMS white list before users can really receive SMS verification code , So don't worry that the verification code will actually be sent to the mobile phone of the head of the mobile phone number , And there will be no SMS deduction .
Friends who like software testing , If my blog helps you 、 If you like my blog content , please “ give the thumbs-up ” “ Comment on ” “ Collection ” One button, three links !
Good article recommends
Why is the test post a giant pit ?10 The tester told you not to be fooled
Interview must ask Linux The order will help you tidy up …
边栏推荐
- 栈和队列的基本使用
- 人脸注册,解锁,响应,一网打尽
- In depth analysis of mobilenet and its variants
- Win the championship for 2 consecutive years! ZABBIX ranked first in a number of monitoring software in 2022
- What are the conditions for a mature knowledge management?
- Scope of groovy
- OpenVINOTM 2022.1中AUTO插件和自动批处理的最佳实践
- [deeply understand tcapulusdb technology] tmonitor system upgrade
- 微信小程序之input前加图标
- Quartus II 13.1 安装步骤详解
猜你喜欢

Detailed description of Modelsim installation steps

实战 | 如何制作一个SLAM轨迹真值获取装置?

微信小程序之从底部弹出可选菜单

Deci 和英特尔如何在 MLPerf 上实现高达 16.8 倍的吞吐量提升和 +1.74% 的准确性提升

Input adjustment of wechat applet

PHP receiving and sending data
![[Course preview] AI meter industry solution based on propeller and openvino | industrial meter reading and character detection](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[Course preview] AI meter industry solution based on propeller and openvino | industrial meter reading and character detection

Flex attribute of wechat applet

Ks003 mall system based on JSP and Servlet

渗透测试-提权专题
随机推荐
Interrupt and polling
Tencent cloud tdsql-c heavy upgrade, leading the cloud native database market in terms of performance
微信小程序之在wx:for中绑定事件
Crmeb second open SMS function tutorial
Edge and IOT academic resources
前AMD芯片架构师吐槽,取消 K12 处理器项目是因为 AMD 怂了!
MIT 6.031 Reading5 : Version Control学习心得
同花顺是股票用的么?现在网上开户安全么?
微信小程序之input调整
Basic data types of C language and their printouts
AGCO AI frontier promotion (6.23)
Proofs of Elsevier Elsevier Journal (Neptune Neptune) (problems encountered: latex remove the chapter number)
Loss, duplication and backlog of message queues
KS007基于JSP实现人个人博客系统
The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
Digraph D and e
Modelsim 安装步骤详解
构建英特尔 DevCloud
如何正确计算导入Excel的行数(POI/NPOI)
Common usage of OS (picture example)
