Apache JMeter is a popular open-source testing software.JMeter is a Java-based application for performance testing.
It is mainly used for testing the Web application or FTP application, but also currently it is applicable in JDBC database connections, functional testing, etc. The Apache JMeter is an open-source, purely Java-based software. The software is used to perform performance testing, functional testing, and load testing of web applications. It is used to test load testing functional behavior and measuring performance.
Now it is coming to mind what language we are using in JMeter.
The Groovy language is used as a scripting language for JMeter. When it comes to improving JMeter's functionality, Groovy has proven to be a powerful, and yet lightweight, language in terms of performance
Following is a list of protocols supported by JMeter:
Web Services - SOAP / XML-RPC
Web - HTTP, HTTPS sites 'web 1.0' web 2.0 (ajax, flex and flex-ws-amf)
Database via JDBC drivers
Directory - LDAP
Messaging-oriented service via JMS
Service - POP3, IMAP, SMTP
Advantages of JMeter
JMeter is a highly capable tool that can handle load and performance testing for different products, irrespective of the server or protocol. Be it HTTP or HTTPS web services, database, FTP, LDAP, MOM (Message-oriented Middleware).
Easy to use without extensive knowledge of programming. ...
Provides integration with Jenkins and reporting.
Key features like the Thread Group help to see whether software performance is good.
Open source license: JMeter is totally free, and allows developers use the source code for the development
Friendly GUI: JMeter is extremely easy to use and doesn’t take time to get familiar with it
Platform independent: JMeter is 100% pure Java desktop application. So it can run on multiple platforms
Full multithreading framework. JMeter allows concurrent and simultaneous sampling of different functions by a separate thread group
Visualize Test Result: Test result can be displayed in a different format such as a chart, table, tree and log file
Easy installation: You just copy and run the *.bat file to run JMeter. No installation is needed.
Highly Extensible: You can write your own tests. JMeter also supports visualization plugins that allow you to extend your testing
Simulation: JMeter can simulate multiple users with concurrent threads, and create a heavy load against web applications under test
Support multi-protocol: JMeter does not only support web application testing but also evaluates database server performance. All basic protocols such as HTTP, JDBC, LDAP, SOAP, JMS, and FTP are supported by JMeter
Record & Playback – Record the user activity on the browser and simulate them in a web application using JMeter
Script Test: Jmeter can be integrated with Bean Shell & Selenium for automated testing.
Let’s See How does JMeter work?
JMeter simulates a group of users sending requests to a target server, and return statistics information of the target server. After the server response, JMeter collects all responses. Once the data is collected, JMeter calculates statistical details. In the end, JMeter returns statistics that show the performance/functionality of the target server/application via tables, graphs, etc.
Let's see how to download,
install JMeter and how its works:
JMeter Setup :
Download and install the latest version of Java.
Open the command prompt
Put the command java -version
If you have Java installed in your system, the command will show the version of Java installed, else, before going forward with the installation of JMeter, you must install Java.
2. Download JMeter
· To download JMeter go to the Apache JMeter website
· On the website go to the binaries section and download the zip file
· Wait for the zip folder to be downloaded
3. Install JMeter
· Once the zip folder is downloaded, go to the folder location, and then extract the zip folder
· Once the folder is extracted go inside that folder and then go inside the bin folder here
· In the bin folder open the jmeter.bat file
It will take a while to open, and this is how you can download and install JMeter onto your system
Now when you have installed JMeter, you can execute a test for the same.
4. Create the First Test Plan
The first step in creating the test plan is
Adding a Thread Group
· Open the JMeter window
· The window is divided into two parts. The left side has all the added elements, while the right side has all the elements' configurations.
· Rename the test plan and save it
· Now, rename it as the FirstJMeter.
· Right-click on the test plan.
· Go to add -> Threads (Users) -> Thread Group
Now, once you click on the Thread Group, there are three things on the screen that are important concerning the load test:
· The number of threads (users):
This is the number of threads or users JMeter will simulate.
Let's make it 100.
· Ramp-Up Period (in seconds):
This is the time that JMeter takes before starting the thread over.
Let’s keep this as 12.
· Loop Count:
This is the number of times the test will be executed.
And this one, let's leave it to be 1.
The next step is to
Add an HTTP Request
· Right-click on FirstJMeter and again go to add
· In the drop-down select samplers
For now, choose the simplest of them all, the HTTP request.
Here you will have to give the address to some home pages or websites.
Now, rename it to HomePages.
Here, in the Server Name or IP box, you have to give the server name or the IP.
Let's pick up a website; for now, take Simpli learns website.
· Copy the URL
· Come back to the JMeter window and paste it into the Server Name box.
Don't give HTTP or HTTPS since these are protocols that will come in the other box. They will be automatically taken in the HTTP request case.
· Then in the path dialog box, leave a forward slash there.
Now, when the HTTP test is ready, the next step is to perform the test on it. To perform the test:
To determine what the results of the test will be, you need to add some more test elements.
· Right-click on FirstJMeter
· Go to listener options
In the box that appears, there are different types of reports that JMeter provides.
For now, select the two of these:
· View results in table
· View results tree
Run the test
· Now, save the test and run it
· For running the test, click the green button
· Now, check the results of the test
· Go to view results in table
You can see the green status that shows that the test was successful. The label name: FirstJMeter and the sample time can be seen.
· Then check “view results in a tree”
The green status or the success status can be seen here as well.
The test will be performed concerning the number of users, the ramp-up period, and the loop count set up in the first step.
Hence, here on the screen, it is evident that the test is still running. The time is taken, the number of tests being performed, and the status of each hit on the Simplilearn website can be seen.
And this is how performance testing is performed with the help of JMeter.