Learning to create a basic test plan for testing a Web site will create 5 users to send requests to two pages. Each test needs to run two times.
So, the total number of HTTP requests = 5 (number of users) x 2 (2 requests) x 2 (Repeat send 2) + 20 HTTP requests
To build a test plan, you will use the following elements:
- Thread Group
- HTTP Request
- HTTP Request Defaults
- Graph Results
1 adding users
Add Thread Group
The first step is to add a thread group, which tells JMeter the number of users to impersonate, how often the user sends the request, and how much the user sends.
Right-click the test plan:
Note that you need to modify the default property values. Click the thread Group you just created:
- Name: Thread Group names
- Number of Threads (number of users): quantity of users sending requests
- Ramp-up Period (interval s): Tell JMeter to start all users for a total of time, if the user set 5 here for 5 seconds, then 1 seconds to start a user, if set to 0 all start these users at the same time
- Loop Count: Repeats the number of times that the test plan is repeated, without checking forever otherwise it will always be executed
Note: These values have been modified to take effect immediately! The above values have been modified to take effect immediately! The above values have been modified to take effect immediately! Do not need to press save.
The following changes are followed:
2 Adding a default HTTP request
We've defined our users, and now it's time to define the tasks they need to perform.
Right-click the thread group you just added:
Next, check the added element configuration property
Name: Setting names
Web server ' s server NAME/IP: All HTTP requests are sent to the same server (in this case, jmeter.apache.org), this example only fills in this one field
The setup is complete as follows:
The HTTP request default does not allow JMeter to send HTTP requests, but defines the default values that are used for HTTP requests.
3 Adding support for cookies
Usually all Web tests should support cookies. Add an HTTP Cookie manager to each thread group.
To add support for cookies:
4 Adding an HTTP request
Send two requests: http://jmeter.apache.org/and http://jmeter.apache.org/changes.html
JMeter will send the request in the order in which they appear in the tree.
The first one:
Name: Names
Path: route, set here to/(to ensure that the full address is configured in the HTTP Request Defaults element)
The second one:
Create a Web test plan