JMeter Web Test Plan
In this section, you will learn how to create a basic test plan to test a web page.
For our test purpose, we will test the performance of the web page shown by the URL- https://tutoraspire.com/
Create JMeter Test Plan
- Go to your JMeter bin folder and double click on the ApacheJMeter.jar file to launch JMeter interface.
- Click on the Test Plan node.
- Rename the test plan as Demo Test.
- Select the Demo Test node and right click on the selected item.
- Mouse hover on “Add” option, then elements list will be displayed.
- Select Threads (Users) > Thread Group.
- Rename this thread group as Users.
- For this test Users element means the number of users visiting the tutoraspire home page.
Add Sampler
We have to add a sampler in our Users element (Thread Group).
- Select the Users element (Thread Group) and right click on the selected item.
- Mouse hover on “Add” option, then elements list will be displayed.
- Select Sampler > HTTP request option.
- It will add an empty HTTP Request Sampler.
Now, we have to configure the fields of HTTP Request Sampler. It includes:
- Name – Visit tutoraspire Home Page.
Server Name or IP – In our case, web server name will be www.tutoraspire.com. Protocol – This field is left unaltered. Path – we will write it as “/”(slash). It indicates that we want the root page of the server.
Add Listener
- Select the Users element.
- Mouse hover on “Add” option, then elements list will be displayed.
- Select Listener > View Results Tree option.
Save and Execute Test Plan
- Click on File > Save Test Plan as.
- Save the entire test plan as tutoraspire_home.jmx.
- Click on Run > Start to execute the test plan.
Note: Sometimes we need to run a test plan multiple times. We can choose running the test plan without saving it.
Verify the Output
Since, we have left the settings of Users element (Thread Group) as single thread (one user) and loop for 1 time (run only 1 time). Consequently, we will get the result as a single user request in the View Result Tree Listener.
This test plan is meant only for one request. But JMeter is capable of sending the same request, as if many users are sending it. To test the web servers with multiple users, we need to change the Users element (Thread Group) settings.
The first tab of View Results Tree panel is Sampler result. It shows JMeter data as well as data returned by web server.
The Sampler result tab shows all the Response headers sent by the web server.
The second tab of View Results Tree panel is Request, which shows all the data sent to the web server as part of the request.
The last tab of View Results Tree panel is Response data. It shows the data received from server in text format.