当前位置:网站首页>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 …
边栏推荐
- Gary Marcus wrote: three perspectives from linguists that AI researchers need to know
- leetcode:42.接雨水
- How to solve the task cache compilation problem caused by gradle build cache
- KS003基于JSP和Servlet实现的商城系统
- What is the principle of live CDN in the process of building the source code of live streaming apps with goods?
- Monitor the cache update of Eureka client
- Add Icon before input of wechat applet
- 【深入理解TcaplusDB技术】Tmonitor系统升级
- How deci and Intel can achieve up to 16.8x throughput improvement and +1.74% accuracy improvement on mlperf
- Face registration, unlock, respond, catch all
猜你喜欢

微信小程序之获取php后台数据库转化的json

KS007基于JSP实现人个人博客系统

如何正确计算导入Excel的行数(POI/NPOI)

白皮书丨英特尔携手知名RISC-V工具提供商Ashling,着力扩展多平台RISC-V支持

串口、COM、UART、TTL、RS232(485)区别详解

Drop down menu scenario of wechat applet

Develop a powerful tool for increasing efficiency - vscode plug-in sharing in 2022

使用OpenVINOTM预处理API进一步提升YOLOv5推理性能

【课程预告】基于飞桨和OpenVINO 的AI表计产业解决方案 | 工业读表与字符检测

Go write file permission WriteFile (filename, data, 0644)?
随机推荐
The way out after the development of Internet technology -- the birth of IVX
DTU上报的数据值无法通过腾讯云规则引擎填入腾讯云数据库中
MySQL single database and table splitting using MYCAT
Basic use of stacks and queues
Intelligent digital signage solution
How to write vite plug-ins
Tencent cloud tdsql-c heavy upgrade, leading the cloud native database market in terms of performance
火绒安全与英特尔vPro平台合作 共筑软硬件协同安全新格局
CRMEB 二开短信功能教程
Digraph D and e
Sqlserver2008r2 failed to install DTS component
Low grain prices hurt farmers, low wages hurt farmers!
Basic data types of C language and their printouts
[deeply understand tcapulusdb technology] table management of document acceptance
How to use androd gradle module dependency replacement
KS008基于SSM的新闻发布系统
What does it mean for AI developers after 2022
构建英特尔 DevCloud
IEEE Transaction期刊修改过程记录
vulnhub靶机Os-hackNos-1
