Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
Distributed Load Test and recording login test are two different test plans in JMeter. JMeter is an open-source and pure Java-based testing software. As the choices in real life vary from person to person, similarly different factors determine which type of testing needs to be performed.
Based on such factors, there are two types of tests - Distributed Load test and recording login test. In this article, we'll be discussing the difference between these two tests.
Introduction to JMeter
Before we learn the difference between Distributed load test and Recording login test, we should have a quick recap of what JMeter is.
JMeter is a Java application developed by Stefano Mazzocchi. It is open-source testing software. JMeter can be used on any platform that accepts JVM(Java Virtual Machine). It was first introduced to test web applications. Later on, its use expanded to other functions.
At present, it is used to load test functional behavior, measure performance on static and dynamic resources, and for database server tests. The steps to install JMeter on your systems:
Click on apache-jmeter-5.5.zip (or another updated version) in Binaries
The files inside this folder look like this:
Go to the bin folder and click on the jmeter.bat file to run JMeter.
The JMeter GUI(Graphic User Interface) will open. This look like this:
Now that we know what JMeter is and have also downloaded the JMeter let's see what is distributed load test and recording login test.
What is Distributed Load Test and Recording login test?
Distributed load testing uses multiple systems to perform testing. It is applied for testing the website and server application when multiple clients are working simultaneously. We need some web pages for testing distributed load test plan. So, we are taking three pages of Coding Ninjas' website. These are:
Menu page - www.codingninjas.com
Courses page - www.codingninjas.com/courses
Career Camp page - www.codingninjas.com/careercamp
We will create our distributed load test and recoding login test using these web pages. The steps for creating distributed load test plan are:
In JMeter GUI, click on the test plan name.
Rename it to Distributed Load Test Plan.
Right-click on this test plan and hover your mouse on the “Add” option.
Select Thread(User), and then Thread Group.
Now add HTTP (Hypertext Transfer Protocol) RequestsSampler to this Thread Group.
Add Sampler
To do so, follow the below-mentioned steps:
Right-click on the thread group.
Hover the mouse on the "Add" option.
Select sampler, and then HTTP Request.
Configure this HTTP request by giving the name and Server name or IP.
Name - Name of the web page. In our case, it is ‘Menu’.
Server name or IP - your web server name. In our case, it is ‘www.codingninjas.com‘
Our HTTP request will look like this:
As we have taken three pages, so copy the thread group. And paste it into the test plan node two times.
Modify these two HTTP request samplers' names and server names or IPs. Also, specify their path names.
For the second sampler
Name - Courses
Server name or IP - www.codingninjas.com/courses
Path name - courses
For the third sampler
Name - Career Camp
Server name or IP - www.codingninjas.com/careercamp
Path name - careercamp
The directory structure of distributed load test plan will look like:
Add Listener
Before saving and running the test, we need to add an aggregate report to see the results.
Right-click on “Distributes Load test Plan”.
Hover the mouse on the “ADD” option
Select Listener and then the Aggregate report option.
Save and Run
Go to File, and click on the “Save” option.
A pop-up window will appear similar to this:
Save the test plan as a .jmx file.
Go to the “Run” option. Click START or press Ctrl - R
Output
You can view the result in the Aggregate report.
From the distributed load test and recording login test, we are now left with the recording of a login test. HURRAY!!! Half of the work is done. Come on let’s complete the remaining part.
Recording Login Test
For this, we need a chrome extension, BlazeMeter. The BlazeMeter reads all the HTTP requests made by the user and creates a JMeter script. This script can be used and downloaded to generate a .jmx file. You just need two clicks to add BlazeMeter as your chrome extension. These are:
After this, you will be redirected to the demo test page.
Wait until the test is not completed. It may take a few minutes.
The results will be displayed as:
To perform the login test, you need a publicly available website having successful login. We will be using the login page of the Coding Ninjas website.
Downloading .JMX File
The steps for recording the login test are as follows:
Go to the login page.
Fill in your login credentials.
In BlazeMeter, give the name of the test as "Recording Login Test".
Now click on the red circle to start recording.
After login, stop recording.
Now click on the "save" button.
Select JMeter(JMX) option and the domain we chose is codingninjas.com.
You will get a .jmx file in the Downloads folder.
Creating Test Plan
In JMeter GUI, click on the test plan name.
Rename it to ‘Recording Login Test’.
Open the downloaded .jmx file. Go to File > open.
Locate the file and click Open.
The directory structure of this file looks similar to the below image. It contains all the necessary files like variables, requests, cache, authorization, cookie, and header.
Add Listener
Before saving and running the test, we need to add a view result tree to see the results.
Right-click on "Recording Login Test".
Hover the mouse on the "ADD" option
Select Listener and then the View Result Tree option.
After this, go to Run and click Start to get results.
Output
After execution, you can view the result in the view result tree listener.
Now let’s see some frequently asked questions.
Frequently Asked Questions
What is JMeter?
JMeter is an open-source Java application used for testing purposes.
What is Blazemter?
It is a brand new free chrome extension that enables you to record, update and run your test scripts. It keeps your data safe and secure by providing access to only authorized users.
What is Distributed Load Test?
Distributed load testing uses multiple systems to perform testing. It is applied for testing the website and server application when multiple clients are working simultaneously.
What is a .jmx file?
A JMX file refers to a JMeter file in XML(Extensible Markup Language). It stands for Java Management Extension.
What are some features of JMeter?
Some features of JMeter are good performance, recording and playback, scripting, report generation, integration with CI/CD (Continuous Integration and Continuous Deployment), customization, ThreadGroup, and analysis tools.
Conclusion
In this article, we saw what is distributed load test and recording login test. We also discussed what is JMeter, and how to install it. Further discussed the process of creating and running distributed load test and recording login test. We hope that now you have a clear understanding of the topic and are ready to perform testing yourself!
Apart from distributed load test and recording login test, there are other API testing tools too. To name some,