How to create transactions in JMeter

To create transactions in JMeter we do have a separate assertion called Transaction Controller

The Transaction Controller generates an additional sample which measures the overall time taken to perform the nested test elements.

Attribute
Description
Generate Parent Sample
If checked, then the sample is generated as a parent of the other samples in View Results in Table, else it is generated as an independent sample in View Results in Table.
Include duration of timer and pre-post processors in generated sample
Whether to include timer, pre- and post-processing delays in the generated sample. Default is false

















Make sure that all the required elements under a transaction must be moved to a specific Transaction Controller to get the exact response times.

How to record a script on JMeter

The recording procedure in the JMeter was explained below in different steps.

Step 1:

Start JMeter by double clicking on “jmeter.bat” in bin folder of JMeter directory

Step 2:

Add a new Thread Group by right clicking on the Test Plan in JMeter

Test Plan à Add à Threads (Users)à Thread Group



Step 3:

Add Recording Controller by right clicking on the Thread Group

Thread Group à Add à Logic controller à Recording Controller


Step 4:

Rename the Recording Controller with the transaction name, by entering the required name in 

Recording Controller à  Name


Step 5:

Add “HTTP(S) Test Script Recorder” by right clicking on the Workbench

Workbench à Add à Non-Test Elements  à HTTP(S) Test Script Recorder



Step 6:

Select the HTTP(S) Test Script Recorder tab in WorkBench

Enter the same port number that you have configured in proxy settings under Global Settings Port

Note: Need to mention domain address in the “HTTPS Domains” field if you are recording a HTTPS application.

Select the “Target Controller” field to set where the script needs to be stored

Click “Start” button to record


Step 7:

Go to browser and enter the application URL in the address bar. Navigate according to the transaction.

Step 8:

After completion of recording the transaction, go to JMeter and click on “Stop” button.
Ensure that the script was recorded properly by expanding the corresponding “Recording Controller”

(Ex: Home_Page)




Configuring the browser proxy settings

Before recording the application in JMeter, set the browser proxy as (Here I have done using IE browser to set the proxy settings)

Step 1:

Start the Browser, e.g.: Internet Explorer
Step 2:

Click on the tool bar, Click à Tools à Internet Options
Step 3:

Select the “Connections” tab of the Internet Options





Step 4:

             Click on the “LAN Setting” under Connections tab, Disable all the other settings of the “LAN Settings”, select the option “Use a proxy server for your LAN” update the fields.


Address
localhost
Port
8080





Note:  As Mozilla Firefox has its own independent proxy, the changes made in Mozilla will reflect only in that particular browser and rest of the browser will work fine.

JMeter Installation Procedure


As we know that JMeter was developed using Java-Swings, it is mandatory to install Java Development Kit (JDK version above 1.6) to run.

Step 1:

Download and install the JDK version above 1.6 and set the environment variables to point the base directory location where Java was installed on the machine

Step 2:

Download the JMeter source file latest version from the apache link mentioned below 


As it is an open source it doesn’t required any license.
Extract the downloaded .zip file in the required location where it is need to be installed.

Step 3:

To run JMeter go to bin directory of the extracted folder and click on the



Operating System
File to run
Windows System
jmeter.bat
Linux System
jmeter.sh
Mac Operating System
jmeter.sh

Prerequisites to install JMeter

As JMeter is a light weight tool which does not have any installation procedure to do (Please refer JMeter Installation Procedure), the minimum hardware requirements for running the JMeter in a machine is mentioned below


Prerequisites for Jmeter
Software and Hardware
Minimum Hardware Requirement
Recommended Hardware
JDK
JDK 1.6 and above
JDK 1.6 and above
RAM
Not Specific
4 GB
Processor
Not Specific
Processors with Minimum 4 MB Cache
Memory
Not Specific
80 GB
Operating System
Windows, Unix and Mac
Windows, Unix and Mac
Jmeter
Any Version
Jmeter 2.11


Note: Recommendations mentioned above are given by my experiences and it is not specified by Apache

Pros and Cons of JMeter

Pros of JMeter

·         Very light weight tool and can be installed easily
·         As it is an open source tool you need not to be worried on license
·         There are multiple plugins that are available in the market and can be installed easily according to the requirement
·         Caching and offline analysis/replaying of test results

 Cons of JMeter

·         It can be used only on web applications
·         Consumption of memory is high in GUI Mode and performance testing like Load, Stress and Endurance with high user load are preferred to run in NON-GUI mode
·         Complex scenario cannot be done using JMeter thread group
·         Recording in this is complex, as we need to setup the proxy manually

·         It supports only Java coding for custom coding

About JMeter


JMeter is an open source performance testing tool which supports different types of protocols and technologies. It is initially developed in NON-GUI mode to do performance testing on the Apache JServer (Apache Tomcat) and later enhanced to GUI mode which is used to do performance testing with a graphical interface using the swing API interface. The developed application was enabled to run on different types of environment like Windows, UNIX, Linux and Mac OS.
List of protocols that JMeter supports
·         Web - HTTP, HTTPS
·         Web Services: SOAP / XML – RPC
·         FTP
·         Database via JDBC
·         LDAC
·         Message-oriented middleware (MOM) via JMS
·         Mail - SMTP(S), POP3(S) and IMAP(S)
·         MongoDB (NoSQL)
·         Native commands or shell scripts
·         TCP