How to View Results in JMeter

Your SEO optimized title

How to View Results



Add View Result Tree in Listener to see results. The results in this can be viewed after replay, In the view results tree we can look into

Sample Results:

Which consist of thread group number, sample/thread start time, load time in ms, latency, size in bytes, headers size in bytes, body size in bytes, sample count, error count, response code, response message with response headers included.

Request:

The request window consist of URL request type and also the URL.

Response data:

The response data window consist of response for the particular request, where we can view in different formats like

  •       Document
  •       HTML
  •       HTML Download resources
  •       JSON
  •       RegExp Tester
  •       Text
  •             XML
  •       XPath Tester 





Thread Groups in JMeter

Thread Group


Thread group element controls the number of threads that will be used to execute in your test. In this you can control the number of threads, the ramp up time, execution time and start and stop time of the test.

Available only after enable of scheduler, used to choose the startup delay

Attribute
Description
Action to be taken after a Sampler error
Continue - ignore the error and continue with the test
Start Next Loop - ignore the error, start next loop and continue with the test
Stop Thread - current thread exits
Stop Test - the entire test is stopped at the end of any current samples.
Stop Test Now - the entire test is stopped abruptly. Any current samplers are interrupted if possible.
Number of Threads
Number of users to simulate
Ramp-up Period
To initialize the users on to server
Loop Count
Denotes the number of times the user to perform a particular test
Delay Thread creation until needed
Waits until the completion of the time mentioned to create threads
Scheduler
To enable or disable the scheduler
Start Time
Available only after enable of scheduler, used to mention at what point of time the execution need to be started
End Time
Available only after enable of scheduler, used to mention at what point of time the execution need to be stopped
Duration
Available only after enable of scheduler, used to mention how long the execution is to be happened.
Note: If duration time is mentioned, then the end time will be ignored
Startup delay
Available only after enable of scheduler, used to choose the startup delay



Fig: Thread Group with Scheduler enabled


Fig: Thread Group with Loop Count


 jp@gc – Stepping Thread Group


This thread group will start [ 100 ] threads (Users) –> Total number of users are 100.

First Wait for [ 0 ] Seconds. –> There will not be any delay to start the thread once you will run Jmeter.

Then start [10] threads every 30 Seconds —> every 30 seconds 10 threads will start till 100 Threads.

Using Ramp up [5] seconds –> each users taking .5 seconds to hit the server.

Then hold load for [60] seconds –> Once all the threads started it will hold the thread running for 60 seconds.

Finally, Stop [5] threads every [1] sec. –> in each second 5 thread will stop.



Fig: Stepping Thread Group

How to Configure Load Generators in JMeter (Master & Slave)

How to configure Load Generators (Slave & Master)


Adding Load Generators in JMeter should follow some basic steps like

Things to do on JMeter – Controller (Master):


Step 1:

Go to bin directory in JMeter and open JMeter.properties file using Notepad

            apache-jmeter-2.11 à bin à jmeter.properties

Step 2:

Add the slave computers IP address in the “remote_hosts=xxx.x.x.x”

Note:
We can add multiple IP’s by separating using the “,” operator




Things to do on Load Generator Machines (Slave):


Invoke the jmeter-server.bat file in the slave machines before connecting to the master machine.

           apache-jmeter-2.11 à bin à jmeter-server.bat

Note: Do refer the following link for detailed information on configuring the load generators



Timer (Think Time and Pacing Time)

Timer (Think Time & Pacing Time)



The user waiting time between user transactions and iterations is called as timer; in general it is measured in milliseconds.

There are different types of timers
  •          Constant Timer
  •          Gaussian Random Timer
  •      Uniform Random Timer

Constant Timer


If you want to have each thread pause for the same amount of time between requests, use this timer.


Gaussian Random Timer


It pause each thread request for a random amount of time, with most of the time intervals occurring near a particular value. The total delay is the sum of the Gaussian distributed value (with mean 0.0 and standard deviation 1.0) times the deviation value you specify, and the offset value.



Uniform Random Timer


It pause each thread request for a random amount of time, with each time interval having the same probability of occurring. The total delay is the sum of the random value and the offset value.



Assertions in JMeter (Checkpoints)

Assertions (Checkpoints)


It is used to verify the response generated for sampler.
There are multiple types of assertions in JMeter, some of them are
  •          Response Assertion
  •          Duration Assertion
  •          Size Assertion

Response Assertion


The response assertion control panel lets you add pattern strings to be compared against various fields of the response. Add the Response Assertion as a child tag for each HTTP Request Page.




Attributes of Response Assertion


Attribute
Description
Apply to
Main sample only - it applies to the main samples
Sub-samples only - it applies to the sub-samples
Main sample & sub - samples - it applies to both the main & sub Samples
JMeter Variable - it applies to the contents of the named variable
Response Field to Test
Instructs JMeter which field of the Response to test
Ignore status
Instructs JMeter to set the status to success initially. When the Ignore Status checkbox is selected, the Response status is forced to successful before evaluating the Assertion.
Pattern Matching Rules
Indicates how the text being tested is checked against the pattern
Patterns to Test
A list of patterns to be tested. Each pattern is tested separately. If a pattern fails, then further patterns are not checked

Duration Assertion


The Duration Assertion tests that each response was received within a given amount of time. Any response that takes longer than the given number of milliseconds (specified by the user) is marked as a failed response.




Size Assertion


The Size Assertion tests that each response contains the right number of bytes in it. You can specify that the size be equal to, greater than, less than, or not equal to a given number of bytes.



Parameterization in JMeter / CSV Dataset Config

CSV Dataset Config (Parameterization):


To pass the different set of user inputs for different threads running on the server during the load test execution.
Configure the CSV file in CSV Data Set Config and add in the thread group where it is required

Replace the parameter value as ${Parameter} in corresponding HTTP Request.


Attributes in CSV Data Set Config:


Attribute
Description
Name
Descriptive name for the CSV Data set config that is shown in the tree
Filename
Name of the file to be read and it also specifies the path of the particular file
File Encoding
Used to read the data from the file in the specific encoding format
Variable Names
List of variable names are mentioned using comma delimiter (Parameter Names)
Delimiter
Used to split the records in the file
Allow quoted data?
Allow values to be quoted in double quote or a delimiter
Recycle on EOF?
To specify, file be re-read from the beginning on reaching EOF
Stop thread on EOF?
Specifies to stop reading the file on reaching the EOF
Sharing mode
All threads: File is shared between all the threads
Current thread group: Each file is opened once for each thread group in which the element appears
Current thread: Each file is opened separately for each thread
Identifier/Edit: All threads sharing the same identifier share the same file


Right Click on ThreadGroup–> Add–>Config Element–> CSV Data Set Config



How to do correlation in JMeter

Correlation in JMeter / Regular Expression Extractor

Allows user to extract values from the server response using a Perl-type regular expression. As a post-processor, this element will execute after each Sample request in its scope, applying the regular expression, extracting the requested values, generate the template string and store the result into the given variable name.


1.1     How to write a regular expression


Step 1:

Run the particular test and try to identify the dynamic value in the in the View Results Tree.

Note:
Need to run for multiple times and compare the results manually. Some external tool can be used to compare the response.

Step 2:

Identify the LB, RB of the dynamic value

Step 3:

Write the regular expression for the dynamic value using the LB and RB. Check the particular regular expression using View Results Tree.

Step 4:

Find the occurrence (match number) for the required dynamic value

Step 5:

Add the regular expression extractor for the previous request.


Note: In the above figure, the regular expression mentioned was an example. 

Some Regular Expressions Parameters:

Characters
Description
()
It captures null value between LB and RB
(.+?)
It captures the correlated value between LB and RB. This function is used for ord=1 case or ord=all case
(.\d)
It captures the correlated value as digit format between LB and RB
(.*)
It captures the correlated value as character between LB and RB


Attributes in Regular Expression Extractor:

Attribute
Description
Name
Descriptive name for this element that is shown in the tree.
Apply to
Main sample only - only applies to the main sample
Sub-samples only - only applies to the sub-samples
Main sample and sub-samples - applies to both.
JMeter Variable - assertion is to be applied to the contents of the named variable
Response Field to check
Body - Used to check only in the body of the response
Body (unescaped) - Used to check the body of the response, with all Html escapes codes replaced.
Headers - may not be present for non-HTTP samples
URL - Used to check in the URLs
Response Code - Used to check based on the response code
Response Message - Used to check based on the response message
Reference Name
Name of the parameter variable
Regular Expression
Need to substitute the regular expression created
Template
The template used to create a string from the matches found
Match No.
Indicates which match to use
Default Value
If the regular expression does not match, then the reference variable will be set to the default value.


How to see the response in JMeter..?

JMeter will not capture the response for the transaction at record time (So there is no Generation Log as in LoadRunner).

To do Correlation in JMeter was bit typical than any other commercial tools. The response can be viewed in by adding the "View Results Tree" listener. Where you can view the results in the tree view format. In this listener we can find Response Code, Request, Response.

The Response can be view in different formats like "Text, HTML View, Document, XML, XPath Tester, JSON, RegExp Tester".



Note: Add View results tree in workbench while recording to store the response for the recording time.

About JMeter Plugins and the installation

As we know JMeter is an open source tool, there are many plugins available in Market and this plugins can be downloaded from (http://jmeter-plugins.org/). The brief intro of this plugins are well described below

1.1      Standard Set

Standard Set is the basic plugin for JMeter, which includes common elements like Thread Groups, Timers, Listeners (Graphs), Pre-Processor, Post-Processor and Samplers.


Listeners
Active Threads Over Time
Composite Graph
Console Status Logger
Flexible File Writer
Hits per Second
Loadosophia.org Uploader
PerfMon Metrics Collector
Response Times Over Time
Synthesis Report
Transactions per Second
Threads
Stepping Thread Group
Ultimate Thread Group
Timers
Throughput Shaping Timer
Pre Processor
Inter-Thread communication preprocessor
Post Processor
Inter-Thread Communication PostProcessor
Sampler
Dummy Sampler


1.2     Extras Set

Extras Set plugin is an extension to the Standard Set and it has included some elements in Listeners, Config Elements, Pre-Processor, Post-Processor and Sampler.

Listeners
AutoStop Listener
Bytes Throughput Over Time
DbMon Samples Collector
Graphs Generator
JMXMon Samples Collector
Page Data Extractor
Response Codes per Sec
Response Latencies Over Time
Response Times Distribution
Response Times Percentiles
Response Times vs Threads
Transaction Throughput vs Threads
Config Element
Lock File Config
Variable From CSV File
Pre Processor
Raw Data Source PreProcessor
Post Processor
XML format postprocessor
Sampler
HTTP Raw Request
UDP Sampler























1.3 Extras with Lib Set

Extras with Libs Set plugin is an extension to the Extras Set plugin, which need some additional libs to be installed in the JMeter. There are few additional elements added to the sampler.

Sampler
Dummy Sampler
HTTP Raw Request
UDP Sampler
JSON to XML Converter
Oauth Sampler


1.4   WebDriver Set

WebDriver Set plugin is used to do Selenium/WebDriver testing like WebDriver Sampler (Full Browser Test), AndroidDriverConfig (Android Web Browser), ChromeDriverConfig (Chrome Browser for test), FirefoxDriverConfig (Mozilla Firefox Browser based testing compatable with version 22 and 26), HtmlUnitDriverConfig.


1.5  Hadoop Set


Hadoop Set plugin is used to do performance testing on Hadoop and HBase applications.


How to Install JMeter Plugins


The installation of JMeter plugin requires very few steps like
Step 1:

Download the required plugin from http://jmeter-plugins.org/

Step 2:

Extract the .zip file of the plugin in a location

Step 3:

Copy the extracted plugin files into JMeter in the below folder order

apache-jmeter-2.11 à lib à ext