What you don't know about the performance testing tool Jmeter...

When it comes to performance testing, everyone will definitely think of Jmeter and LoadRunner. These two tools are currently widely used in China. The main reason is that Jmeter is open source and free, and LoadRunner 11 has a cracked version in the live network. Commercial performance testing tools are difficult for small and medium-sized enterprises to bear the relevant costs. Domestic performance testing tools include: CPTS (Huawei), kylinTOP (Qilin), PTS (Ali), etc. The foreign performance testing tool LoadRunner is relatively famous. The reason why Loadrunner is famous in China is mainly because LoadRunner entered the Chinese market relatively early, and there are cracked versions on the Internet. Now we mainly study the Jmeter tool. It is often seen on the Internet that netizens complain that the results of the Jmeter tool test are inaccurate, and why the inaccuracy is the monk of Zhang Er is puzzled. So today I will share with netizens what are the restrictions on the use of Jmeter tools, in order to help netizens and improve their awareness of Jmeter tools.

The Apache Software Foundation (ASF) is a non-profit charitable organization based in the United States. All ASF products are developed through online collaboration in public forums and distributed from central servers located within the United States. Jmeter is an open source free software of ASF, which is widely used as a performance testing tool by many small and medium-sized companies in China. This tool is not intended to be used for performance testing, but for developers to debug interface functions.

To do performance or stress testing in Jmeter, you must first create a thread group. If you need to add transactions to the thread group, you can set the number of concurrent virtual users as needed. The technical route of Jmeter constructing concurrent virtual users is by constructing threads, and each thread runs the same thread group at the same time. In order to clarify the inaccurate statistical results of jmeter, we must first understand the mechanism by which Jmeter operates on HTTP requests in thread groups.

1. Test ideas

Step 1: Record a web page using Jmeter

Step 2: Create a test plan, run the script once, and the running process passes (wireShark captures packets)

Step 3: Analyze the sequence of HTTP requests through the wireShark network capture results.

Step 4: Compare the HTTP request sequence obtained by wireShark packet capture with the screen when browsing the URL for separate access.

2. Select the object to be tested

Based on the above ideas, we select a web URL (HTTP://cloud.10oa.com/trial/view/catalogue.aspx) from the Internet as the tested object

3. While recording the script, press F12 to open the network option of Chorme

Use the proxy recording function that comes with the Jmeter 5.1 tool to record the above URL, and press the F12 key during the recording process to switch to the network option.

Note: When Jmeter is recording, you must press F12 and turn on the network of chrome to record the complete HTTP request, otherwise it may only record the first request.

Page HTTP waterfall chart when Jmeter script is recorded

4. Execute the performance test plan

Click the start button of Jmeter's test plan to start and execute the script once for a single user

Note: This picture obtains the start and end time of the HTTP request through wireShark's network capture, and then draws the waterfall chart through excel

5. Analysis of test results

From the waterfall diagram of the wireShark packet capture analysis of Jmeter's test plan execution results, Jmeter sends HTTP requests serially (the previous request returns and the next request starts to send the request), and the number of concurrency is 1 HTTP, from the start of execution to the end of the last execution, takes more than 3 seconds, and the real browser alone visits the URL for about 1 second.

Jmeter can be used by developers for functional debugging in product development and to do some non-quantitative performance tests. It is not suitable for testers to do quantitative performance tests, let alone output test conclusions based on the test results to mislead others.

If the service provided by the web server is a pure HTTP interface function (non-web page), and the user's access is linear (serial question), you can consider using Jmeter test. Even if the service provided by the web server is a pure HTTP interface function (non-web page), if the user access is non-linear, the test result is also unreliable. Remember, only the linear interface request model is suitable for Jmeter.

Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, if you can use it, you can take it away directly: [Collect at the end of the article]


     [The following is the most complete software test engineer learning knowledge architecture system diagram + full set of materials I compiled in 2023]


1. From entry to mastery of Python programming

2. Interface automation project actual combat

3. Actual Combat of Web Automation Project


4. Actual Combat of App Automation Project

5. Resume of first-tier manufacturers


6. Test and develop DevOps system

7. Commonly used automated testing tools


Eight, JMeter performance test

Nine, a complete set of information on software testing

 10. Summary (little surprise at the end)

life is long so add oil. Every effort will not be let down, as long as you persevere, there will be rewards in the end. Cherish your time and pursue your dreams. Don't forget the original intention, forge ahead. Your future is in your hands!

Life is short, time is precious, we cannot predict what will happen in the future, but we can grasp the present moment. Cherish every day and work hard to make yourself stronger and better. Firm belief, persistent pursuit, success will eventually belong to you!

Only by constantly challenging yourself can you constantly surpass yourself. Persist in pursuing your dreams and move forward bravely, and you will find that the process of struggle is so beautiful and worthwhile. Believe in yourself, you can do it!  

Guess you like

Origin blog.csdn.net/nhb687096/article/details/132298565