JMeter
The Apache JMeter™ application is open source software, a 100% pure Java application designed to load test functional behaviour and measure performance. Apache JMeter may be used to test performance both on static and dynamic resources, Web dynamic applications.
It can be used to simulate a heavy load on a server, group of servers, network or object to test its strength or to analyze overall performance under different load types.
How to install JMeter
- Check java is installed on your system
java-version
- Download JMeter
Apache JMeter – Download Apache JMeter
Download the zip file under binaries
Move the zip file to any location( Local disk (C:)-> Testing Tools-> JMeter)
- Unzip and keep JMeter folder at any location
- Step 1 – Start Jmeter
Windows: jmeter/bin-jmeter.bat
Double click the jmeter ( windows batch file), it opens the JMeter.
Step 2 – Create a TestPlan
TestPlan is created to check the performance of different pages under a single project
File-> New
- Name the test plan. I have given ThermoguardAU
Step 3 – Create a Thread Group (Users)
A Thread group is a way to introduce virtual users to a page to check the performance of the page.
- Follow this to create a thread group ThermoguardAU(right click) >Add>Threads(Users)>Thread Group
- In thread properties, there will be some parameters
- Number of threads is the number of usersRamp-up time is time in milliseconds to introduce a new user to the test.Loop count is the period for the test execution. If loop count is set forever then the test will execute until the user forcefully stop the execution
Step 4 – Add a Sampler (HTTP)
The sampler is used to run the test. We will use an HTTP sampler as we’ll be testing the performance of a website
- Follow this to create a sampler THRAU(right click) >Add>Sampler>HTTP request
- First name the sampler as AUHTTP
- Give Server name or IP for this page as http://www.test-thermogard-au.ml/
- Protocol is given as https
- Path is the exact page of the website we want to test /Categories-au
- Keep the rest of the parameters as it is
Save the test plan
Note: The test plan could not be saved with Look and feel selected as Darklaf-Darcula, so changed to Metal
Step 5 – Add Listeners
Elements that gather information about the performance test used to view results/metrics of the test.
There are many more listeners available for different tests. For the performance of an HTTP page, we’ll use two basic listeners i.e. results table and results in tree.
- Follow this to create a listener THRAU(right click) > Add > Listeners > View Results in Table & THRAU((right click) > Add > Listeners > View Results Tree
- Here in listeners, we will be able to see the results of our test
Step 6 – To Run the Test
- After creating samplers and listeners we are now ready to run our first test
- Click on the start button from the toolbar
- AT the top right corner we can see execution time, errors in execution, number of current users and the status of the test
Let’s check the result table
Here we can see different parameters which we can compare with the expected result
- Sample time is the taken to open the page totally
- Status is green means the test is successful
- Latency is the time in milliseconds to get the first byte of information from the page
- Connect time is the time in milliseconds to connect to the website