Jmeter Quick Guide
Jmeter Quick Guide
Before going into the details of JMeter, let us first understand a few jargons associated with the
testing of any application.
Performance Test − This test sets the best possible performance expectation under a
given configuration of infrastructure.
Load Test − This test is basically used for testing the system under the top load it was
designed to operate under.
Stress Test – Stress testing is defined as types of software testing that verifies the stability
and reliability of the system. It tests beyond the normal operating point and analyses how
the system works under extreme conditions. Stress testing is performed to ensure that the
system does not crash under crunch situations. Stress testing is also known as Endurance
Testing or Torture Testing.
What is JMeter?
JMeter is a software that can perform load test, performance-oriented test, regression test, etc., on
different protocols or technologies.
1. Stefano Mazzocchi of the Apache Software Foundation was the original developer of
JMeter.
2. He wrote it primarily to test the performance of Apache (JServ now called as Apache Tomcat
project).
3. Apache later redesigned JMeter to enhance the GUI and to add functional testing
capabilities.
4. JMeter is a Java desktop application with a graphical interface that uses the Swing
graphical API.
5. It can therefore run on any environment / workstation that accepts a Java virtual machine,
for example − Windows, Linux, Mac, etc.
JMeter Features
GUI.
2. JMeter can conduct load and performance test for many different server types −
Web - HTTP, HTTPS, SOAP, Database via JDBC, LDAP (Lightweight Directory
on JMeter shell script. On Windows, it can be invoked by starting the jmeter.bat file.
4. It has full Swing and lightweight component support pre compiled JAR uses packages
javax. swing. ∗ .
5. JMeter store its test plans in XML format. This means you can generate a test plan
6. Its full multi-threading framework allows concurrent sampling by many threads and
7. It is highly extensible.
8. It can also be used to perform automated and functional testing of the applications.
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.
Take a look at the following figure that depicts how JMeter works −
JMETER - ENVIRONMENT
JMeter is a framework for Java, so the very first requirement is to have JDK installed in your
machine.
System Requirement
First of all, verify whether you have Java installed in your system. Open your console and execute
one of the following java commands based on the operating system you are working on.
OS Task Command
Windows Open Command Console c:\> java -version
Linux Open Command $ java -version
Terminal
Set the JAVA_HOME environment variable to point to the base directory location, where Java is
installed on your machine. For example −
OS Output
OS Output
After a short pause, the JMeter GUI should appear, which is a Swing application, as seen in the
following screenshot −
JMETER - BUILD TEST PLAN
A Test Plan can be viewed as a container for running tests. It defines what to test and how to go
about it. A complete test plan consists of one or more elements such as thread groups, logic
controllers, sample-generating controllers, listeners, timers, assertions, and configuration
elements. A test plan must have at least one thread group.
This is a plain and blank JMeter window without any additional elements added to it. It contains two
nodes −
Elements Test Plan Elements) can be added to a test plan by right-clicking on the Test Plan node
and choosing a new element from the "add" list.
Alternatively, you can load an element from a file and add it by choosing the "merge" or "open"
option.
For example, let us add a Thread Group element to a Test Plan as shown below −
To remove an element, make sure the element is selected, right-click on the element, and choose
the "remove" option.
Right-click on the existing tree element to which you want to add the loaded element.
Select Merge.
Choose the file where you saved the elements.
JMeter will merge the elements into the tree.
By default, JMeter does not save the element, you need to explicitly save it.
To save tree elements −
Any element in the Test Plan can be configured using the controls present in JMeter's right-hand
side frame. These controls allow you to configure the behavior of that particular test element. For
example, the Thread Group can be configured for a number of users, ramp up periods, etc., as
shown below −
You can save an entire Test Plan by using either Save or "Save Test Plan As ..." from the File
menu.
Step 6 − Run the Test Plan
You can run the Test Plan by clicking StartControl + r from the Run menu item. When JMeter
starts running, it shows a small green box at the right-hand end of the section just under the
menubar.
The numbers to the left of the green box are the number of active threads / total number of
threads. These only apply to a locally run test; they do not include any threads started on remote
systems when using client-server mode.
Using Shutdown Control +′, ′. It requests the threads to stop at the end of any current work.
WINRUNNER
1. WinRunner is an Automation Software Testing Tool that was developed by Mercury Interactive.
2. It is known and extensively used for its ability to supports the majority of the programming languages
and web development technologies such as C, C++, C#, Visual Basic, Java, HTML, Power Builder, etc.
3. It is used for performing various testing techniques, which includes the functional testing, user interface
testing, integration testing, regression testing, etc., by making use of its options to record the
functionality for creating test steps and by using the playback UI interactions option for generating the
test scripts.
4. The testing process here goes by capturing the functional requirement/ test requirement, by verifying the
actual results against the expected results and by replaying the user operations/ functional activities
5. In this process, the tool can involuntarily perform the complete testing process while identifying the
defects with respect to the product design provided by the business/ client personnel.
6. The WinRunner Automation tool uses the Test Script Language (TSL) that is identical to the C
programming Language in terms of receiving the user activities as the process input and by allowing
the user performs various activities on the software that is subjected to the testing process.
It picks on the several objects embedded inside the application like the graphical user interface including the
windows, the navigation flow, the lists, the buttons, the bitmaps/ images, the page segmentation, the page
contents, etc. In this mode, whenever any activity is initiated in the application for the testing purpose, a TSL
statement will be created as a part of the test script used for the test execution process, so as to describe the
2. Analog Recording
Analog recording mode in the WinRunner application is used for recording each and every mouse click, the
inputs received from the keyboard, and the accurate coordinates picked up from the mouse in the form of a two
dimensional (X, Y) input. During the test execution, this testing tool tracks down the mouse movements to
gather the mentioned information. And so, this mode of Analog Recording in WinRunner is applied whenever
the precise mouse coordinate is required as the input for test execution.