Reference: http://jmeter.apache.org/usermanual/build-web-test-plan.html
Scene
5 Users concurrent Testing Baidu search, there are two requests, a request to search "Hello", a request to search "HelloWorld".
Configure users
Add a thread group.
On the test Plan, right-click to add the thread Group.
Set as follows: 5 users concurrent access system, 1 seconds to prepare the user, each user access loop 2 times.
Adding Configuration Components
Since we have multiple identical requests, we can add an HTTP configuration component directly to manage the configuration of the common part of the request.
Right-click on the Thread group to add the HTTP Request Defaults.
For example, we want to access the IP address contains "https://www.baidu.com/s", we can put this information in the HTTP Request defaults inside the configuration, so that it does not have to be configured in each sampler.
Server Name or IP:www.baidu.com
path:/s
Add an HTTP request
A request to search "Hello", a request to search "HelloWorld".
Right-click on the thread group to add an HTTP Request.
Name:search_ Hello. Update request name convenient to distinguish.
Parameters: Add the parameter wd, the value is "Hello". Why is WD not the other one? Because the Baidu search box name is "WD". The value is the value we want to search for.
The same method adds the request "Search_helloworld".
Add Listener
We need to observe the test results and send the request. So you need to add listening.
I prefer to use the view Results Tree to view the execution details, then use graph Results to view the run graph, and use the aggregate report to view the summary results.
Run
Click the Run button to run the test plan.
You can see that the Stop button is still running and you see the Run button light up again to indicate that the test has finished running.
View Test Results
During the run, you can see the results in real time in listener. Of course, all results can be seen after the run is finished.
View the results tree to see all the requests sent and the specific data requested.
For example, now that we have 5 users, loop 2 rounds and have 2 requests per round, view Results tree will see 5x2x2=20 requests.
Because each user's process is not ready at the same time, while the push has a fast and slow, the speed will also affect, so you can see the following request, the user 1 of 2 requests are sent out, the other users began to send the request.
Sending a successful request will have a green hook, and sending the failed request shows red.
Click on the specific request, you can switch sampler result, request, Response Data View the request. Request is what is actually sent out, Response data is the Response that the request returns. If the request is not successful, we can look at these two things to see what the specific reason is.
The overall situation report is listed here.
Three: Build a web Test Plan