0% found this document useful (0 votes)
43 views12 pages

Jmeter Quick Guide

Uploaded by

shalima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views12 pages

Jmeter Quick Guide

Uploaded by

shalima
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

JMETER - OVERVIEW

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.

The protocols supported by JMeter are −

Web − HTTP, HTTPS sites 'web 1.0' web 2.0

Web Services – SOAP (Simple Object Access Protocol) / XML

Messaging Oriented service via JMS Java Message Service


Service − POP3(Post Office Protocol), IMAP (Internet message access protocol), SMTP
FTP Service

JMeter Features

Following are some of the features of JMeter −

1. Being an open-source software, it is freely available. It has a simple and in-built

GUI.
2. JMeter can conduct load and performance test for many different server types −

Web - HTTP, HTTPS, SOAP, Database via JDBC, LDAP (Lightweight Directory

Access Protocol), JMS, Mail - POP3, etc.

3. It is a platform-independent tool. On Linux/Unix, JMeter can be invoked by clicking

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

using a text editor.

6. Its full multi-threading framework allows concurrent sampling by many threads and

simultaneous sampling of different functions by separate thread groups

7. It is highly extensible.

8. It can also be used to perform automated and functional testing of the applications.

How JMeter Works?

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

JDK 1.6 or above.


Memory No minimum requirement.
Disk Space
No minimum requirement.
Operating System
No minimum requirement.

Step 1 − Verify Java Installation

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

Step 2 − Set Java Environment

Set the JAVA_HOME environment variable to point to the base directory location, where Java is
installed on your machine. For example −

OS Output

Windows Set the environment variable JAVA_HOME to C:\


Program Files\Java\jdk1.7.0_25

Linux export JAVA_HOME=/usr/local/java-current

Mac export JAVA_HOME=/Library/Java/Home

Append Java compiler location to System Path.

OS Output

Windows Append the string; C:\Program Files\Java\jdk1.7.0_25\bin to the end of the


system variable, Path.

Linux export PATH=PATH: JAVA_HOME/bin/


Mac not required

Verify Java Installation using java -version command as explained above.

Step 3 − Download JMeter

Download the latest version of JMeter from http://jmeter.apache.org/download_jmeter.cgi. For this


tutorial, we downloaded apache-jmeter-2.9 and copied it into C:\>JMeter folder.

Step 4 − Run JMeter

After downloading JMeter, go to the bin directory.

After a short pause, the JMeter GUI should appear, which is a Swing application, as seen in the
following screenshot −
JMETER - BUILD TEST PLAN

What is a 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.

Writing a Test Plan

Follow the steps given below to write a test plan −

Step 1 − Start the JMeter Window

Open the JMeter window by clicking /home/apache-jmeter-2.9/bin/jmeter.sh. The JMeter


window will appear as below −

This is a plain and blank JMeter window without any additional elements added to it. It contains two
nodes −

Test Plan node − is where the real test plan is kept.


Workbench node − It simply provides a place to temporarily store test elements while
not in use, for copy/paste purposes. When you save your test plan, Workbench items are
not saved with it.

Step 2 − Add/Remove Elements

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.

Step 3 − Load and Save the Elements

To load an element from file −

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 −

Right-click on the element.


Choose the Save Selection As ... option.
JMeter will save the element selected, plus all the child elements beneath it. By default, JMeter
doesn't save the elements, you need to explicitly save it as mentioned earlier.

Step 4 − Configuring the 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 −

Step 5 − Saving the Test Plan

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.

Step 7 − Stop the Test Plan

You can stop your test in two ways −

Using Stop Control +′. ′. It stops the threads immediately if possible.

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

performed on the software product.

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

remarkable flexibility for modification and applying a constraint to the same.

WinRunner testing modes are given below:

1. Context Sensitive Recording


The Context Sensitive mode is applied for recording the software application’s functional aspects as and when

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

object selection and the respective action carried out.

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.

You might also like