Goal: to complete the deployment JMeter environment and basic use
Tutorial demo environment (environment only for reference):
- Platform: Windows platform
- System Version: Windows 10 Chinese version of Home
step:
- Get JMeter
- Deployment JMeter
- Configuration settings
- JMeter start method
- Basic use JMeter
Step 1: Get JMeter
- Official website address: https://jmeter.apache.org/
- Download: https://mirror.bit.edu.cn/apache//jmeter/binaries/apache-jmeter-5.2.1.zip
Step 2: Deploying JMeter
Premise deployment: the 5.2.1 version in this tutorial use JMeter for example, requires Java 8 (JDK) or higher and support!
- JDK environment availability verification method
Windows键 + r键
Open the Run window, typecmd
, click "OK" to open a command line
-
- In the command line window that opens, type:
java -version
and press Enter
- In the command line window that opens, type:
Show similar results shown below, that is, a JDK is available
Description: JMeter tool itself is free installation, and therefore directly extract files can be downloaded
- Extract the downloaded
apache-jmeter-5.2.1.zip
archive file
NOTE: The path decompression can not contain spaces and Chinese , otherwise problems may arise during use
- Good results decompressed file shown in FIG.
- Enter decompression good folder directory, visible as shown in the file directory is the successful deployment
Step 3: configure the settings
- Get the path deployed JMeter file directory (this layer to see all the files in the directory)
- Go to "Computer" -> "Properties"
"This Computer" right click and select "Properties"
- Go to "Advanced System Settings" -> "Advanced" -> "Environment Variables"
- Go to "Environment Variables" -> "System Variables" -> "New"
- Configuration as illustrated below, the configuration, click "OK" to save the configuration
variable name:JMETER_HOME
variable value:D:\apache-jmeter-5.2.1
(the JMeter installation path acquired)
- New
CLASSPATH
variables ( Note: as already exist can be used directly ), is configured as shown below, the configuration, click "OK" to save the configuration
variable name:CLASSPATH
variable value:.;%JMETER_HOME%\lib\ext\ApacheJMeter_core.jar;%JMETER_HOME%\lib\jorphan.jar;
Note: If it is already present in theCLASSPATH
added variable, then the variable the foremost value. "" may be omitted!
Step 4: JMeter Start Method
JMeter into the bin file in the root directory folder (startup mode has 3 kinds can choose one!)
- Double-click the left mouse button
jmeter.bat
- Double-click the left mouse button
ApacheJMeter.jar
- In the command line window in the current path:
java -jar ApacheJMeter.jar
Step 5: JMeter basic use
- Speaking Interface: Go to "Options" -> "Choose Language " -> Chinese (Simplified)
Note: This step is temporary finished, the next time start JMeter, need to modify the option again
- Speaking after effect
- Extended: Speaking permanent method
- Go to "JMeter install root \ bin" of the path, find the
jmeter.properties
file
- Go to "JMeter install root \ bin" of the path, find the
-
- Open
jmeter.properties
the file, find the location shown below, a corresponding modification, save and exit
the increased value:language=zh_CN
Note: Recommended use something like "Notepad ++" advanced text editor to modify the contents of the configuration file
- Open
-
- Restart JMeter, shown below is the permanent finished successfully
- Simple to use, as shown in the following diagrams:
- Add "thread group"
Test Plan -> Add -> thread (user) -> Thread Group
- Add "thread group"
-
- Add "HTTP request"
thread group -> Add -> Sampler -> the HTTP request
- Add "HTTP request"
-
- Add "View results tree"
thread group -> Add -> Listener -> View results tree
- Add "View results tree"
-
- Set to increase as shown below in "HTTP Request"
-
- Click the "Save" button to save the Test Plan
-
- Click the "Run" button to perform
-
- In the "View results tree," observed the results, so far JMeter end basic use!