Since load/stress testing scenarios are based on mutual interactions between the client and remote, the need of correlation is a technical state every performance tester encounters at some point.
To establish a strong bond with your test flow, JMeter comes with a handy feature: Regular Expression Extractor under Post Processors.
Reliability of your tests depends on the frequency of buggy occurrences, how robust your design is and how ready you are for unexpected situations.
2. 1
In today’s world, we have to deal with
various behaviors of systems while
communicating with one another.
In most cases, to carry on with test
scenarios, we need to fetch the dynamic
responses from preceding requests and
pass it to the subsequent ones.
By simply parsing and passing the needed
data to the next caller provides a smooth
transition during the test execution process
(Load Test Correlation).
Let’s get started
3. 2
Since load/stress testing scenarios are
based on mutual interactions between the
client and remote, the need of correlation is
a technical state every performance tester
encounters at some point.
To establish a strong bond with your test
flow, JMeter comes with a handy feature:
Regular Expression Extractor under Post
Processors.
Storyline
4. 3
Reliability of your tests depends on the
frequency of buggy occurrences, how robust
your design is and how ready you are for
unexpected situations.
When using static parameters is not
enough…
Tagline
5. 4
After spending some time and going through
the basics of JMeter, it is inevitable not to
get stuck with handling dynamic data in your
complex scenarios. At this very point,
correlation kicks in.
Getting the data parsed from the response
on the fly and passing it to the next request,
plays a vital role in your test flow.
JMeter supports correlation with its
“Regular Expression Extractor” which
provides smooth data transition by using
regular expressions and applies the parsed
data on another sampler in our flow.
Tagline
6. 5
Regular expressions are a set of symbols &
characters which are used to build a pattern
to match character combinations in strings.
Regular expressions are very popular and
used widely in programming languages and
very easy to get used to.
JMeter’s regular expressions are provided
by Jakarta ORO framework based on Perl5
Regex Engine.
There are many great tutorials, websites,
and articles about it, so take your time and
you should be writing your style of patterns
in no time.
Why regular expressions?
7. 6
JMeter’s Regular Expression Extractor helps
us fetch any portion of data from the
response by using regular expressions.
Since applying the regular expressions on
the response is a post process, this explains
why Regular Expression Extractor is located
under Post-Processors.
After matching the set of characters by
using the Extractor, this value is set to a
variable for future use on another sampler.
How JMeter handles
correlation…
8. 7
Regex Extractor has a few options we need
to know in advance.
A. Apply To:
Main Sample -produced by the primary
request- and/or Sub Sample -produced by
any request made related to the primary
request- can be picked to apply the regular
expression.
Getting to the point…
9. 8
B. Response Field To Check:
A Regex can be applied to a part of the
response message such as header, body
etc…
C. Reference Name:
This is the name of the variable which stores
the matched data. This variable can later be
called from another request by simply using
the following syntax: ${}
D. Regular Expression:
Your regex pattern goes here.
Getting to the point…
10. 9
E. Template:
Regex may have more than one group.
Templates – regex group index- are used to
match the group that contains the data.
F. Match No:
Multiple matched sets might return for a
regex pattern. By setting the match number,
data-to-store is chosen from the result set
and set to the variable -reference name-.
G. Default Value:
If there is no match to the regex, then the
default value is set to the variable.
Getting to the point…
11. 10
If you wonder how this technique is applied in practice, please go ahead and take a look at the
following link;
HTTP Live Streaming Performance Test
Happy Load Testing…