In this section, you will learn how to create a basic test plan for a test Web page.
For demonstration testing purposes, we will test the url-https://www.yiibai.com/Web page performance.
Create a JMeter test plan
- Go to the JMeter Install Bin folder and double-click the
jmeter.bat
file to launch the JMeter interface.
- Click the Test Plan node.
- Rename the test plan to Demo test.
- Select
Demo Test
the node and right-click the selected item.
- Hover over the "ADD" option and the list of elements will be displayed.
- Select Threads (Users), Thread Group.
- Rename this thread group to Users.
- For this test, the user element represents the number of users accessing the home page of the site.
Add Sampler
We must add a sampler to the Users element (the thread group).
- Select
Users
the element (thread group), and then right-click the selected item.
- Hover over the "Add" option and the list of elements will be displayed.
- Select the HTTP request option, Sampler .
- It will add an empty HTTP request sampler.
Now, configure the fields for HTTP Request Sampler . It includes:
- Name-access to Easy Hundred site homepage (https://www.yiibai.com).
- Server name or IP-in this example, the Web server name is: www.yiibai.com.
- Protocol-This field remains unchanged. Path-Write it as
/
(slash). It represents the root page of the desired server.
As shown in the following:
Add Listener
- Select the Users element.
- Hover over the "ADD" option and the list of elements will be displayed.
- Select the Listener , View Results Tree option.
Click:Run - Start to execute the test plan.
Note: It is sometimes necessary to run a test plan multiple times. You can choose to run the test plan without saving it.
Validate Output
Because we keep the users element (thread group) set to single-threaded (one user) and Loop 1 times (1 runs only). Therefore, the result is fetched as a single user request in View result Tree Listener .
This test plan applies only to one request. But JMeter is able to send the same request as if many users are sending it. To test a Web server with multiple users, you need to change the users element (thread group) settings.
The first tab of the View Result Tree Panel is "Sampler Result". It shows the JMeter data and the data returned by the Web server.
The Sampler Result tab displays all response headers sent by the Web server.
The second tab of the Sampler result panel is request, which displays all data sent to the Web server as part of the request.
The last tab of the Sampler result panel is the response data . It displays the data received from the server in text format.
JMeter Web test Plan