Introduction to JMeter
JMeter is widely known for its Load and performance testing abilities, however, it is also a wonderful tool when it comes to testing the functionality.
A product which is interacting with APIs (REST, SOAP, XML, etc.) with the outside world needs to be tested for functionality, the answer should be Jmeter.
It is enormously extendable. It is an open source tool, we can create our own plugins, jars to be added in JMeter and run.
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 perform a functional test on websites, databases, LDAPs, web services etc.
The below example will explain how it can be used for functional testing:
Let`s take a scenario, you are doing a Bill Payment using a mobile app like a Paytm or free-recharge etc. For this, your mobile application needs to send a request with your data (like your phone number, the amount of recharge, for which service provider i.e. Airtel/Vodafone/Aircel etc bill has to be paid) to Vodafone for the deduction of money.
How is this done?
An API (a request message in XML, JSON etc.) is created and sent to Vodafone from the mobile application as a request and a response is received from Vodafone.
How JMETER is used?
JMeter can be used to test these APIs independently. We will see in detail step by step how this can be achieved with Jmeter.
With JMeter, we can create a request (simulating the mobile app) and fire it on the environment which communicates with Vodafone & receives a response from them which is shown in Jmeter LISTENERS. We can also create reports in the form of graphs, CSVs, Tables etc.
Upcoming tutorials of JMeter will cater to all those folks who want to create their API test suites in which they can perform Data Driven Testing, they want to verify that the Database is getting updated with expected values.
First things first, let’s see how to set up JMeter
Environment Setup JMeter:
1) JMeter requires a fully compliant JVM 7 or higher. Download the latest version of Java and set up the environment variable.
- Go to command prompt. Type cmd in run box of windows
- Type java -version.
You will see that you get a version of the Java you installed or you will get a message saying that command not recognized.
2) No constraint for Operating System.
3) Download the latest JMeter from the website: – Download JMeter
Download the zip file:- Apache-jmeter-3.0.zip
4) Unzip the file that was downloaded.
Go to the below location JMETER\apache-jmeter-2.13\bin\
Click on “jmeter.bat”. This is the JMeter batch file to run in GUI mode.
Now we can start writing scripts in JMeter. Soon I will come up with first test script.
Happy Learning 🙂
For any Questions, Queries or feedback feel free to write us at email@example.com.