Jmeter performance test environment

1. Environment configuration

Linux environment (jmeter4.0 used this time requires jdk1.8 and above to support)


1. Create a directory, use the root user to log in to the Linux system, enter the / home path, execute mkdir jmeter to create the jmeter directory

2. Upload the Jmeter installation package, enter the jmeter directory, use the rz command to upload the compressed jmeter test software


3. Use unzip apache-jmeter -4.0-performance.zip Unzip the uploaded compressed package

4. After decompression is completed, the apache-jmeter-4.0-performance directory will be generated in the current directory

5. Configure global variables, at this time you can use vim / etc / profile to modify global variables

6. Add export PATH = $ PATH: /home/jmeter/apache-jmeter-4.0-performance/bin

7. Then enter: wq to save and exit, execute source / etc / profile to make the configuration take effect

8. Then also give / home / jmeter /apache-jmeter-4.0-performance/bin Jmeter file execution permissions, first cd /home/jmeter/apache-jmeter-4.0-performance/bin into the bin directory

9. chmod 777 jmeter

10. After the execution is complete, execute jmeter -v can see the following figure, prove that the global variable configuration is successful, you can use the command to perform performance tests

windows environment


1. The installation package placement path, it is recommended to place the jmeter installation package in the main directory of the disk, not in the C drive, as shown below

2. Configure global variables, first create a system variable, the name is JMETER_HOME, the variable value is D: \ apache-jmeter-4.0-performance (fill in according to the actual path)

3. Then add% JMETER_HOME% \ bin to the system variable path, as shown in the figure below 
4. The configuration is complete, click OK, enter jmeter -v on the cmd command line Figure, representing successful configuration 
2. Script development
1. Directory maintenance, use mkdir project command under / home / jmeter to create a project directory

2. Create a folder named after the system locally

3. Create date under devops
4. Then in this Create three subfolders under the file, namely data, result, and script

5. Then create two folders under the log, summary_report, which are used to save the log and aggregate report

6. Parameterized settings, first add user-defined variables , Define a variable as path, the value is relative path format ... / data / name.csv, and the path format is linux environment (windows is compatible with linux format, so that you can implement linux, windwos compatible synchronous environment)


7. First, add a csv file data, the file name changed $ {path}, select the file encoding UFT-8, enter the variable name variable name to be referenced, the file name of the parameter name .csv column name, ignore the first line and select true, other values ​​default


8. Add a file named name.csv in the data directory, and then define the parameter name and parameter value


9. Reference parameter method, change the variable to $ {name} and $ {description} in the variable that needs to call the parameter value, the system can call the variable

10. Package upload, after the case development is completed, save the case to the result directory in

11 cases the development, debugging is complete, the system devops package upload to the linux / home / jmeter / project path, enter rz enter, the system will pop up a message box, you can choose to upload the file


12. then use unzip devops system. Unzip with the zip command


3. Case execution
1. Use the command cd / home / jmeter / project / devops system / 20180703 / script to enter the script path, be sure to enter the script directory, so that you can use the relative path without entering a long Absolute path

2. The command is as follows: jmeter -n -t add check. Jmx -l… / result / summary_report / add check _10_10min.jtl -j… / result / log / add check _10_10min.log

Use this command to call jmeter for performance testing. -T is followed by the name of the script to be executed, -l is followed by the save path of the aggregation report, -j is followed by the log save path, 10 is the number of concurrent users, and 10min is the duration of the scene


3. After the execution is completed, files will be generated in two paths


If the article is helpful to you, welcome to pay attention to my public account. The public account is synchronized with the articles on this platform for easy reference. I will continue to launch articles related to testing and share testing techniques with you. Each original article is written with care. , Put an end to plagiarism


QQ Technology Exchange Group: To add a group, please enter verification information
              Insert picture description here


WeChat QR code pay attention to the public number:

Insert picture description here


After paying attention, reply to the resource download, you can get the download address of various resources shared by me

[External chain image transfer failed, the source site may have an anti-theft chain mechanism, it is recommended to save the image and upload it directly (img-dkyHNY2D-1569554485737) (https://s1.51cto.com/images/blog/201908/06/2e62f8806e1dc1c391c4332ac7fd70b1 .png? x-oss-process = image / watermark, size_16, text_QDUxQ1RP5Y2a5a6i, color_FFFFFF, t_100, g_se, x_10, y_10, shadow_90, type_ZmFuZ3poZW5naGVpdGk =)]

Guess you like

Origin www.cnblogs.com/Jmeter-Automation/p/12730499.html