One, download jmeter
1. The download URL is: http://jmeter.apache.org/download_jmeter.cgi
2. Select the compiled binary compressed package file to install:
3. Double-click the downloaded file to decompress and get the following folder:
Two, install jmeter
1. Click apache-jmeter-5.2.1
2. Right-click the bin directory and select Service -> New Terminal Window
3. Enter the startup command: sh jmeter. If the following content is displayed, the installation is successful!
Three, switch language
1. Click on the [Options] option in the menu bar
2. Select Choose Language-->Chinese(Simplified)
Four, simple to use
1. Add thread group and create thread
2. Add a sampler and create an HTTP request
3. Set the request interface parameters
3. Add a response assertion that the "test" is returning the expected result
4. Set the test mode for responding to assertions
5. Add a listener to view the result tree
5. Start the HTTP request and check the result. If the returned result matches the assertion, it is a green pass mark, otherwise it is red, as shown in the figure:
Five, jmeter foundation
1. Jmeter execution order
- Placement element
- Preprocessor
- Timer
- Sampler
- Post processor
- Affirmation
- Listener
Pre-processors, timers, post-processors, and assertions are processed only when there are applicable samplers. Within a type, elements are processed in the order in which they appear in the tree.
2. Preprocessor: Perform some operations before sending the sampler request. It is often used to modify the settings before the sample request runs, or update the variables of the non-response text.
3. Timer: The timer delays jmeter for a period of time before sending the sampler request to prevent jmeter from sending too many requests in a short period of time, making the server overwhelmed. By default, jmeter executes sampler requests in order without pause.
4. Sampler: Tell jmeter to send the request to the server and wait for the response.
4. Post-processor: After sending the sampler request, perform certain operations. Such as processing response processing, extract data from it.
5. Assertion: Through the assertion, the result returned by the sampler request is tested to determine whether the sent sampler request is successful and correct.
6. Listener: listen to the response data received after jmeter sends the sampler request.