While the previous blog of the performance testing series gave insights on the testing tool Load Runner”, the present one brings an overview on another such valuable tool JMeter.
JMeter is an Open Source Performance Testing tool developed by The Apache Software Foundation.
In a very short span of time, has become very popular performance testing tool compared to other tools in this arena as it provides a lot of powerful features that make it convenient to identify performance bottlenecks.
JMeter supports multiple protocol types which include Web – HTTP, HTTPS ,SOAP ,FTP ,Database via JDBC and LDAP. This tool can also be used to perform functional testing of application that only focuses on Request & Response validation. It is often used for functional testing of web services. The tool’s simple GUI reduces the learning curve for the user thus simplifying the performance testing process.
JMeter is platform-independent, owing to the fact of being purely developed in Java. This makes its possible to run on multiple platforms such as Windows and Linux. This tool possesses a highly extensible core which allows the incorporation of plug-ins that can further enhance its capabilities.
Performance testing tools usually offer recording features that auto-generate scripts based on the user actions captured. Similarly, JMeterTest Plan can be created using recording in the following ways:
HTTP Proxy: JMeter provides HTTP Proxy feature, by configuring proxy settings, port of a browser can be configured such that all the requests executed by the browser are routed through JMeter and it captures all the requests before executing them, thus auto-generating the Test Plan.
Browser plug-ins: JMeter script is stored in .jmx extension which contains request information and settings in xml format. There are browser plug-ins available such as BlazeMeter and BadBoy which allows recording and capturing of http requests and auto-builds the .jmx file, which can be imported by JMeter application and further used for execution.
Major Components
JMeter consists of different components and each is meant for a specific task. Below is the brief description of some components:
Test Plan
A test plan in JMeter is the outline of the Performance Test to be conducted. It lists all the elements that contain information regarding what to test, how to test and what parameters to monitor and report after the test. The test plan also contains a layout on how and what to test.
A complete test plan will consist of one or more elements such as thread groups, logic controllers, sample-generating controllers, listeners, timers, assertions, and co
Thread Group
Thread Group is the beginning point of the test plan. The core objective of Thread Group is to provide the number of simulated users that will execute the requests concurrently. Thread Group is similar to “Scenario” in Loadrunner’s Controller component. All the other elements in the test plan fall under the thread group. As a result these elements get affected by the settings & configuration of the thread group.
Below is the snapshot of a thread group.
Samplers
The sampler element generates the request and targets it to the server. Samplers are the ones responsible for simulating user requests. Samplers have attributes such as Status, Response, Elapsed Time, Data size etc. There is a long list of Samplers that JMeter provides, out which most frequently used are- HTTP Request, FTP Request, JDBC Request, Java Request, SOAP/XML Request and Bean Shell Sampler.
Assertions
Assertion elements are used for validating a response. Without implementing assertions, the JMeter Test Plan just performs basic validation on the response based on the response code. For example, if a response code is 404 (Not Found), then the request is marked as failed. Assertions form an integral part of reliability testing which validates correct application behavior under load.
Some of the most commonly used assertions are:- HTML Assertion, XPath Assertion, Response Assertion, XML Assertion and Size Assertion.
After reading this post our readers are sure to be interested in learning more about JMeter. The next post of the series shall include more insights on JMeter’s major components.
For more information on Testing and QA click here