Introduction
Apache JMeter is open source software which is purely based on Java, designed to test functional and performance both on static and dynamic resources. It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can also use it to perform a functional test on websites, databases, LDAPs, webservices etc.
JMeter is not a browser; JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does, it’s possible to view the response as HTML.
JMeter simulates a group of users sending requests to a target server, and returns statistics that show the performance/functionality of the target server/application via tables, graphs, etc.
Some Features of JMeter
- JMeter can conduct load and performance test for many different server types − Web – HTTP, HTTPS, SOAP, FTP, Database via JDBC, LDAP, JMS, Mail – POP3, etc.
- It’s an open source software and freely available.
- Simple and intuitive GUI. So, that user can use it easily.
- JMeter store its test plans in XML format. This means you can generate a test plan using a text editor.
- Multi-threading framework allows concurrent sampling by many threads and simultaneous sampling of different functions by separate thread groups.
- Perform automated and functional testing for the applications.
- Easy correlation through ability to extract data from most popular response formats, HTML, JSON , XML or any textual format.
Steps to create a Test Plan for Login Page
Step 1:- Select Test Plan, right click on it and hover on add button then hover on Threads and click on Thread Group button.
Test Plan->Add->Threads(users)->Thread group
Step 2:- Now fill the details for the Thread.
The number of Threads(users): Threads means Virtual Users. Total numbers of virtual users you want to use for the test script execution.
Ramp-up Period(in seconds): Ramp-up period defines how much time it takes to execute all thread(users). If Thread is 50 and Ramp-up time is 10 seconds then, it means It will take 10 seconds to execute 50 threads(5 thread per second).
Loop Count: Loop Count is the number of executions for the script.
Step 3:- Now add the HTTP Request from the sampler where you can put the desired URL of your website on which you want to do load testing.
Project_Name -> Add ->Sampler -> HTTP Request
Step 4:- Now put the domain of your Login Page into the ‘Server Name or IP’ field and put rest of the URL into the ‘Path’ field. If your domain contains https than put https into ‘Protocol’ field and change the HTTP request field to POST.
Now you want to pass the credentials of login page then under parameters tab click on add button to pass username and password. Under the name column pass the field name of username and password by inspecting the element.
Step 5:- Right click on “Project_Name(Webkul)” and click on Add button then click on Listener and click on View Results Tree to view the result of your login page test execution.
Project_Name -> Add ->Listener -> View Results Tree
Listeners allows us to view and analyse the Sampler request and response in the form of tables, graphs, trees etc. You can access the sampler result in an ongoing load/stress test without waiting till end using Listeners.
Listeners can be added anywhere in a test plan. It will gather data only from elements defined in its scope.
Step 6:- Now add the HTTP Cookie Manager to manage the cookies of your script.
Project_Name -> Add ->Config Element -> HTTP Cookie Manager
Step 7:- Now to run the script click on run button and see the result of script on the Listener which you have added.
In case you have any queries then feel free to ask in the comment section below.
This is all about Load Testing of a Login Page using JMeter.
Thanks for reading this blog.
Happy testing!!
2 comments
Hello Piyush,
Thanks for your appreciation.
Thanks,
Webkul Team.