Test old bird sorting, Jmeter scene operation mode GUI+command line operation, one click...


foreword

How to run the Jmeter scene (GUI running and command line running)

D1

Operation mode

GUI operation: run through the graphical interface. The visual interface and the dynamic display results of the monitor consume more resources of the load machine in this operation mode. It is recommended not to use it when there is a large amount of concurrency. Generally, script debugging is performed; command line operation: run through the jmeter command line tool
( Performance testing recommends executing scripts via the command line)

Operating framework

Local operation: run a local Jmeter machine, and all requests are sent through this machine.
Remote operation: Use one Jmeter controller to control multiple remote machines to generate load. The communication between the control machine and the load machine is completed through RMI.

Jmeter GUI running

1. Run the script through the inverted triangle icon on the jmeter GUI or start the execution script through the run in the menu bar; as shown below

D2

Note:
The jmeter visual interface and the dynamic display results of the listener both consume load machine resources. It is recommended that it does not affect the performance test results during large concurrency, and generally creates and debugs test scripts;

When performing a performance test, the dos window will also give a prompt when starting jmeter;
as shown below:

D3

The meaning is roughly: Do not use GUI mode for load testing, GUI is only used for Test creation and Test debugging. For load testing, use CLI mode (not GUI);

Jmeter command line operation (the performance test recommends executing the script through the command line)

Description of some parameters of the Jmeter command line tool:
-n: Run in non-GUI mode.
-t: Specify the address and name of the test script to run (the suffix is ​​.jmx file), which can be a relative or absolute path
-h: View help
-l: Record the test results to a file (suffix is ​​.jtl), specify the name and path, It can be a relative or absolute path
-r: open the remote load machine, the remote load machine list is specified in the jmeter.properties file
-R: open the remote load machine, you can specify the load machine IP, which will override the settings in jmeter.properties
-X: Stop remote execution
-J: define Jmeter properties, which is equivalent to setting in jmeter.properties (refer to the detailed explanation of the sixth command in the command line operation below) -G
: define Jmeter global properties, which is equivalent to setting in Global.properties, thread -e: generate
an html report after the script runs
-o: save the address of the html report
-g: specify an existing test result file

Commonly used commands are as follows: jmeter -n -t script path. jmx -l test result path. jtl -e -o html result path (empty folder);
Remarks: You can not write -e -o and the following command will generate a jtl file first. Then use the -g parameter to generate an html report from the jtl file

D4

Note: When Jmeter uses the command line to run for a long time, more than 2 hours, you will find that the jmeter command line has not stopped, but in fact the request has not been sent (the end of run will not appear), if configured at this time The web version report cannot be generated (jtl report can be generated).

Then you can use the -g command to load the jtl file to generate a web version of the report
Command: jmeter -g jtl file path -o html empty folder

D5

jmeter command line operation actual combat

1. Run the script locally and generate a test report, where the suffix of the test report is jtl
jmeter -n -t script path -l test report path

2. Run the script remotely and generate a test report, where the suffix of the test report is jtl
jmeter -n -t script path -r -l test report path

3. Run the script remotely and generate a test report, where the suffix of the test report is jtl
jmeter -n -t script path -R load machine IP -l test report path

4. Run locally and generate a web version test report, where the test result path is an empty directory
jmeter -n -t script path -l test report path -e -o test result path

5. Convert the test result file in jtl format to html format
jmeter -g test result path -o html report path

6. Run the script locally and generate a test report, configure the number of threads and the number of loops on the command line
jmeter -n -t script path -l test result path -JthreadNum=50 -JloopNum=10

To complete the sixth actual combat operation above, that is, the usage of the jmeter command line parameter -J;
use the P function setting of the function assistant dialog box to obtain the command line properties as follows

D6

Configure the generated functions through user-defined variables;
put user-defined variables where they need to be used;

D7

Use the -J parameter when executing in the command line window; as follows:

D8

The following is the most complete software test engineer learning knowledge architecture system diagram in 2023 that I compiled

1. From entry to mastery of Python programming

Please add a picture description

2. Interface automation project actual combat

Please add a picture description

3. Actual Combat of Web Automation Project

Please add a picture description

4. Actual Combat of App Automation Project

Please add a picture description

5. Resume of first-tier manufacturers

Please add a picture description

6. Test and develop DevOps system

Please add a picture description

7. Commonly used automated testing tools

Please add a picture description

Eight, JMeter performance test

Please add a picture description

9. Summary (little surprise at the end)

No matter how many difficulties and challenges you face, you must firmly believe in your own abilities, go forward bravely, and write the glory of life with persistence and hard work. I believe that every effort will not be in vain, and every pursuit will not fail, as long as you don't give up, success will be waiting for you in the future!

We will go through both wind and rain, and we will move forward; watered by sweat, we will achieve brilliance. No matter where you are, as long as you keep fighting, victory will eventually belong to you. Keep moving forward, never shrink back, go forward bravely, and the pace of chasing dreams will never stop! Believe in yourself and harvest the future with all your strength!

Adhere to the original intention, unswervingly determined, accompanied by dreams and hard work, struggle and success. No matter how many challenges and difficulties you encounter, you must persevere, because only by not giving up can you have the opportunity to create brilliance. Believe in yourself, take every step, you will surely usher in a brilliant future!

Guess you like

Origin blog.csdn.net/csdnchengxi/article/details/131832069