当前位置:网站首页>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 …
边栏推荐
- vulnhub靶机Os-hackNos-1
- Tinder security cooperates with Intel vPro platform to build a new pattern of software and hardware collaborative security
- OpenVINOTM 2022.1中AUTO插件和自动批处理的最佳实践
- Detailed explanation of serial port, com, UART, TTL, RS232 (485) differences
- 微信小程序之从底部弹出可选菜单
- [deeply understand tcapulusdb technology] tmonitor background one click installation
- Flutter Clip剪裁组件
- quartus调用&设计D触发器——仿真&时序波验证
- Xmake v2.6.8 发布,编译缓存改进
- 智能数字看板解决方案
猜你喜欢

Use openvinotm preprocessing API to further improve the reasoning performance of yolov5

Stick to five things to get you out of your confusion!

通过 OpenVINO Model Server和 TensorFlow Serving简化部署

Ks007 realizes personal blog system based on JSP

构建英特尔 DevCloud

Error when Oracle enters sqlplus

Intel ® extensions for pytorch* accelerate pytorch

PHP receiving and sending data

How do I turn on / off the timestamp when debugging the chrome console?

2022软科大学专业排名出炉!西电AI专业排名超清北,南大蝉联全国第一 !
随机推荐
Intelligent digital signage solution
How do I turn on / off the timestamp when debugging the chrome console?
Win the championship for 2 consecutive years! ZABBIX ranked first in a number of monitoring software in 2022
2022软科大学专业排名出炉!西电AI专业排名超清北,南大蝉联全国第一 !
Input adjustment of wechat applet
白皮书丨英特尔携手知名RISC-V工具提供商Ashling,着力扩展多平台RISC-V支持
Tencent cloud tdsql-c heavy upgrade, leading the cloud native database market in terms of performance
Multi-Camera Detection of Social Distancing Reference Implementation
The way out after the development of Internet technology -- the birth of IVX
Web technology sharing | [Gaode map] to realize customized track playback
vulnhub靶机Os-hackNos-1
5 technical vulnerabilities related to NFT
2022 年以后,对AI开发人员意味着什么
Oracle进入sqlplus 报错
Shell process control - 39. Special process control statements
SQLserver2008r2安装dts组件不成功
理解ADT与OOP
How to use sed -i command
[Yunzhou said live room] - digital security special session will be officially launched tomorrow afternoon
Intel ® extensions for pytorch* accelerate pytorch
