Sunteți pe pagina 1din 19

JMETER, INSTALLATION AND

WORKING
User Manual: How to Operate JMeter

Documented Date: 13 October, 2016


User Manual: How to Operate JMeter

Document Information

Prepared By:
Reviewed By:
Recommended for
Approval By:
Approved By:

ZaraiTaraqiati Bank Limited Page 2 Information Systems Division


User Manual: How to Operate JMeter

Table of Contents
Chapter 1. Overview:........................................................................................................................................................................................................ 4
1.1. Types of tests that can be done using JMeter:.............................................................................................................................................. 4
Chapter 2. Downloading and installation of JMeter ................................................................................................................................................. 4
2.1. Downloading: ....................................................................................................................................................................................................... 4
2.2. Installation: ............................................................................................................................................................................................................ 5
Chapter 3. Making your first test plan ......................................................................................................................................................................... 5
3.1. Adding thread group ........................................................................................................................................................................................... 5
3.2. Adding Sampler ................................................................................................................................................................................................... 6
3.3. Adding Listener.................................................................................................................................................................................................... 7
3.3.1. View Results in table ................................................................................................................................................................................ 7
3.3.2. View results tree ......................................................................................................................................................................................... 7
Chapter 4. Performance and Load testing ................................................................................................................................................................... 8
4.1. Performance testing............................................................................................................................................................................................. 8
Chapter 5. Recording a UI Test: .................................................................................................................................................................................. 10
5.1. What is recording?............................................................................................................................................................................................. 10
5.1.1. By Using template.................................................................................................................................................................................... 10
Chapter 6. How to read data from a CSV file .......................................................................................................................................................... 14
6.1. Setting up a CSV file: ....................................................................................................................................................................................... 14
6.2. How to log in multiple users at a time in CBAS using a .CSV file: .................................................................................................... 16

ZaraiTaraqiati Bank Limited Page 3 Information Systems Division


User Manual: How to Operate JMeter

Chapter 1. Overview:
The Apache JMeter™ application is open source software, a 100% pure Java application
designed to load test functional behavior and measure performance. It was originally designed
for testing Web Applications but has since expanded to other test functions.
1.1. Types of tests that can be done using JMeter:
Apache JMeter may be used to test performance both on static and dynamic resources (Web
services (SOAP/REST), Web dynamic languages - PHP, Java, ASP.NET, Files, etc. -, Java
Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load
on a server, group of servers, network or object to test its strength or to analyze overall
performance under different load types. You can use it to make a graphical analysis of
performance or to test your server/script/object behavior under heavy concurrent load.
Chapter 2. Downloading and installation of JMeter
2.1. Downloading:
As JMeter is an open source software it can be easily downloaded from the official web site of
Apache i.e. http://jmeter.apache.org/ and by clicking on download releases you can get latest
version of JMeter.

Note: Note that you have to click on zip files for downloading JMeter.

ZaraiTaraqiati Bank Limited Page 4 Information Systems Division


User Manual: How to Operate JMeter

2.2. Installation:
Following steps must be followed while installation of JMeter into your system
1. As JMeter is a pure java application it works only in the environment where java is
installed.
2. If you don’t have java or JDK installed you must have to download it first by clicking on
the given link
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-
2133151.html
3. After installing JDK go to your downloads i.e. where you have downloaded JMeter,
extract it because it is a zip file.
4. This extracted folder may contain many sub menu find the “bin” then click on j-meter,
remember that you have to click on bat file, for opening JMeter.
5. Steps would be like this downloads>jmeter>bin>Jmeter batch file
6. Following will be the front screen of Jmeter.

Chapter 3. Making your first test plan


3.1. Adding thread group
1. As JMeter is an automated testing tool for this we make test plans, test plan and work
bench are pre-defined instances located at JMeter.
2. Write click on test plan>add>threads (users)> thread group.
3. Following screen will be shown.

ZaraiTaraqiati Bank Limited Page 5 Information Systems Division


User Manual: How to Operate JMeter

4. In this window we have three basic parts that need understanding:


a. Number of threads (users), how many users do you want to check at a time.
b. Ramp-Up Period (in seconds), in how much time users should be checked.
c. Loop count
3.2. Adding Sampler
Samplers are something that take http request this request will be the address or path of the site
which we want to test.
Following will the screen of sampler.

ZaraiTaraqiati Bank Limited Page 6 Information Systems Division


User Manual: How to Operate JMeter

3.3. Adding Listener


When the request is generated, the result of that request will be shown through listeners, we have
different types of listeners here. Some of commonly used listeners with screen shots are as
follows.
3.3.1. View Results in table
This will generate results in table having some attributes

3.3.2. View results tree


This sampler will display results in tree wise structure, this listener is not recommended mostly,
because it consumes a lot of memory.

ZaraiTaraqiati Bank Limited Page 7 Information Systems Division


User Manual: How to Operate JMeter

Chapter 4. Performance and Load testing


4.1. Performance testing
It is also called load testing, suppose we want to test 100 users at a time it is very difficult to
check each user manually so in our thread group section we would increase the users by 100 and
run our test plan, you have to save the test plan before running it.
Following are the screen shots of performance and load testing.

ZaraiTaraqiati Bank Limited Page 8 Information Systems Division


User Manual: How to Operate JMeter

Here we have seen that all the users are tested by a single button.
Note: Note that the green sign show the success behavior and the red sign indicates the failure of
the test plan.
A fail test plan would be like this:

ZaraiTaraqiati Bank Limited Page 9 Information Systems Division


User Manual: How to Operate JMeter

Chapter 5. Recording a UI Test:


5.1. What is recording?
Recording is something we want to check the behavior of our website in JMeter window. We can
recording the behavior of website by many ways, some of them are as follows.
a. By using template
5.1.1. By Using template
If you want to record behavior by using built in template you have to perform following step.
Click on file> templates, following screen will be shown.

ZaraiTaraqiati Bank Limited Page 10 Information Systems Division


User Manual: How to Operate JMeter

Click on create button, you would have the following screen.

Here some of the attributes are shown by default i.e.


a. User default variables
b. HTTP Request Defaults
c. HTTP cache Manager
d. Thread Group, in its sub menu we have recording controller which save the records of
website
e. view results tree shows the results
f. workbench, in its sub menu we have HTTP(s) Test Script Recorder
If we click on this HTTP(s) Test Script Recorder we will have following screen containing a start
button at its end. By clicking on this start button JMeter is now at the stage of recording your
website.

Note: We will have to configure our browser for such type of recording, it only works on Mozilla
Firefox, and for configuring following will be screen.

ZaraiTaraqiati Bank Limited Page 11 Information Systems Division


User Manual: How to Operate JMeter

Now in your browser write down the address of your website and you clearly seeall the actions
are recording into the JMetre.
Following are some screens of recording a UI test using templates.

ZaraiTaraqiati Bank Limited Page 12 Information Systems Division


User Manual: How to Operate JMeter

ZaraiTaraqiati Bank Limited Page 13 Information Systems Division


User Manual: How to Operate JMeter

Chapter 6. How to read data from a CSV file


6.1. Setting up a CSV file:
We can also read data from a CSV (Comma Separated File), for this we have to make a file with
extension .csv that can be either in bin folder or anywhere in your computer. Following are the
steps through which we can read a data from a csv file.
1. Make a test plan, add thread group and add some child of the thread group as HTTP
request manager, HTTP header manager and HTTP request defaults.

ZaraiTaraqiati Bank Limited Page 14 Information Systems Division


User Manual: How to Operate JMeter

2. After that you should add sampler and add a child of it ADD CSV DATA SET CONFIG,
see following figure.

3. In this data set confiq, you have to type file name and variable name which you are
passing for the user login.
4. In HTTP request following image will guide you to type some parameters of the request.

ZaraiTaraqiati Bank Limited Page 15 Information Systems Division


User Manual: How to Operate JMeter

5. Because I have my variables as email and password in the .csv file, you use any variables
which you want.
6. Following will be the result of this .csv data set config.

6.2. How to log in multiple users at a time in CBAS using a .CSV file:
JMeter also allow logging into same application by many users at a same time. This can easily be
done using a csv file which contain PP No, Password and verification code. We call this csv file
into our JMeter script and run the script for the results. This script also has live recording of
application under test and we apply csv data set config in our request.
Following are the screen shots of script.
1. We have CBAS application under test. First of all we will record the application behavior
which is previously done.

ZaraiTaraqiati Bank Limited Page 16 Information Systems Division


User Manual: How to Operate JMeter

2. Add csv file in login request.

3. Write login credentials to the request.

ZaraiTaraqiati Bank Limited Page 17 Information Systems Division


User Manual: How to Operate JMeter

At this stage when we run the script we will clearly see that user of multiple branches are logging
into CBAS. Following are the screen shots for the passed script.

ZaraiTaraqiati Bank Limited Page 18 Information Systems Division


User Manual: How to Operate JMeter

ZaraiTaraqiati Bank Limited Page 19 Information Systems Division

S-ar putea să vă placă și