当前位置:网站首页>This set of steps for performance testing using JMeter includes two salary increases and one promotion
This set of steps for performance testing using JMeter includes two salary increases and one promotion
2022-06-27 22:00:00 【Software testing】
Project background
Our platform is a national industry monitoring platform , after 3 Wheel function test 、 After interface test ,98% The problem has been closed , It is decided to conduct performance test on the interface for uploading data from provincial platform to national platform .
01
testing procedure
1、 Write a performance test plan
Because I just entered this project team soon , Only participated in it 3 Functional test of modules , One interface regression test , So when writing a performance test plan , First, the business process 、 The business functions have been sorted out , Focus on the documentation of the interface to be tested again , Under the guidance of the tutor , Have a better understanding of the functions of each interface response , The biggest gain is , The performance test should correspond to the actual function of each interface , Design appropriate use cases , Such as : For an object , There are two kinds of data upload , One is real-time data , One is historical data .
here , The stability of continuous upload should be considered more for real-time data , Historical data should be more concerned about the accumulation of data , Upload more than one at a time (1000 strip ) Data , We should pay more attention to the data after uploading correctness , integrity .
After sorting out the functions of each interface and the logic of data upload , Each one Interface performance test Methods 、 Test items 、 The required data are well designed , After finishing, it is our test plan . Here are some screenshots ,
The test plan is written when the actual operation attempt is feasible , Areas that need to be adjusted found in the follow-up implementation process , Adjusted according to the actual demand . At the end of the document, I will attach the problems and solutions in this performance test , I hope it will be helpful to the new performance test friends ~
2、 Discussion of test scheme
Submit the test plan to the supervisor for review , The plan was discussed in a group meeting , The team leader puts forward improvement suggestions for inappropriate places , Colleagues put forward their own ideas , There are still unclear areas that have become clearer in our discussions . After discussion , The test plan becomes more suitable for the needs of the project 、 More feasible . Some screenshots that need to be modified this time are as follows :
3、 Performance test execution
We use Jmeter Tools to test . The interface information is as follows :
Test script usage Java To write , The data is packaged as json Format .
4、 Output test report
5、 Analyze the data
6、 Troubleshoot problems
7、 Performance improvements
02
Case sharing
An interface case is analyzed in detail below – Historical data upload .
1、 Create a thread group : open Jmeter.bat, The graphical interface appears , Click successively as shown in the figure below :
2、 add to HTTP Default request : This accessory is added to control the access address and port of this thread group , Click here in turn :
To configure HTTP Default request parameters , According to the... To be tested IP And port , As shown below :
3、 Database connection configuration : Because we need to get enterprise information from the database , So configure the database connection ( Use configuration components -JDBC Connection configuration ), If you log in with the a fixed user name and password , This step can be omitted .
JDBC Connection configuration :

4、 Add controller only once : It belongs to logic controller , It is used to control the execution sequence of the sampler . Because users here only need to log in once , So use the controller only once , That means that the content under this controller will only cycle once in the operation of the whole thread group .
5、 add to HTTP request : To add under the once only controller , To be controlled by it .HTTP Request belongs to Sampler( Sampler ), Then fill in... According to the relevant contents of the interface document http Request content .

6、 Add regular expression extractor : Need to be in http Request to add... Below , Because from http In the response result of the request, we use regular expressions to extract what we need key.
Regular expressions :
(): The enclosed part is to be extracted .
.: Match any string .
+: Once or more .
?: Don't be greedy , Stop after first match found .
(3) Templates : use
To quote , If there are multiple regular expressions in a regular expression , It can be 23 2 3 23 wait , Represents the amount of the resolved value to the reference name ( Such as :key). Such as : 1 1 1 Represents resolved to 1 It's worth .
(4) Match the Numbers :0 Represents a random value ,1 Represents all values , Generally, filling 0.
(5) The default value : If the parameter does not get a value , It defaults to a value .
7、 Add get current time : Use the... In the sampler BeanShell Sampler. For convenience in Redis When you check the data in, you know when it was uploaded . The number of times to extract the current time needs to be written in the sampler java Script .

8、 Use java Write a script to set up upload data , Also used here Bean Shell Sampler Sampler . Data needs to be json Format . here , The sampler will be added under the thread group , Because the data may have to be uploaded repeatedly , If only part of the screenshot is as follows :
9、 add to http request , Upload the data just set that meets the interface requirements .
10、 Add listener 
Set the location where the running log is saved in the listener .
11、 View the results after running .
The house needs to be built layer by layer , Knowledge needs to be learned at one point one . We should lay a good foundation in the process of learning , More hands-on practice , Don't talk much , The last dry goods here ! I stayed up late to sort out the stages ( function 、 Interface 、 automation 、 performance 、 Test open ) Skills learning materials + Practical explanation , Very suitable for studying in private , It's much more efficient than self-study , Share with you .
Get off w/x/g/z/h: Software testing tips dao
Typing is not easy , If this article is helpful to you , Click a like, collect a hide and pay attention , Give the author an encouragement . It's also convenient for you to find it quickly next time .
边栏推荐
- [LeetCode]572. 另一棵树的子树
- 百万年薪独家专访,开发人员不修复bug怎么办?
- The create database of gbase 8A takes a long time to query and is suspected to be stuck
- QT base64 encryption and decryption
- Summary of gbase 8A database user password security related parameters
- [LeetCode]508. The most frequent subtree elements and
- win11桌面出現“了解此圖片”如何删除
- Go from introduction to actual combat - context and task cancellation (notes)
- 管理系统-ITclub(中)
- Matlab finds the position of a row or column in the matrix
猜你喜欢
![[LeetCode]动态规划解分割数组II[Arctic Fox]](/img/a1/4644206db3e14c81f9f64e4da046bf.png)
[LeetCode]动态规划解分割数组II[Arctic Fox]

Go from introduction to actual combat -- channel closing and broadcasting (notes)

Go从入门到实战——任务的取消(笔记)

Process control task

. Net learning notes (V) -- lambda, LINQ, anonymous class (VaR), extension method

使用Jmeter进行性能测试的这套步骤,涨薪2次,升职一次

Express e stack - small items in array

我想我要开始写我自己的博客了。
![[MySQL] database function clearance Tutorial Part 2 (window function topic)](/img/03/2b37e63d0d482d5020b7421ac974cb.jpg)
[MySQL] database function clearance Tutorial Part 2 (window function topic)
![[LeetCode]动态规划解拆分整数I[Silver Fox]](/img/18/8dc8159037ec1262444db8899cde0c.png)
[LeetCode]动态规划解拆分整数I[Silver Fox]
随机推荐
Dynamic refresh mapper
regular expression
Software defect management - a must for testers
Figure countdownlatch and cyclicbarrier based on AQS queue
At 19:00 on Tuesday evening, the 8th live broadcast of battle code Pioneer - how to participate in openharmony's open source contribution in multiple directions
[LeetCode]508. 出现次数最多的子树元素和
Set code exercise
[LeetCode]572. 另一棵树的子树
Test automatique de Test logiciel - test d'interface de l'introduction à la maîtrise, apprendre un peu chaque jour
动态刷新mapper看过来
[Sword Offer II]剑指 Offer II 029. 排序的循环链表
\W and [a-za-z0-9_], \Are D and [0-9] equivalent?
[LeetCode]572. A subtree of another tree
AQS SOS AQS with me
[leetcode] dynamic programming solution partition array ii[arctic fox]
QT base64 encryption and decryption
[LeetCode]动态规划解拆分整数I[Silver Fox]
Go from starting to Real - Interface (note)
Go from introduction to practice - polymorphism (note)
Stm32cubeide1.9.0\stm32cubemx 6.5 f429igt6 plus lan8720a, configure eth+lwip