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.
|
Here, you shared the most valuable post. I'm really happy to read this. Thank you.
ReplyDeleteJMeter Training in Chennai
JMeter Training in Velachery
JMeter Training in Tambaram
JMeter Training in Anna Nagar
JMeter Training in Tnagar
javascript training in chennai
core java training in chennai
C C++ Training in Chennai
I would definitely thank the admin of this blog for sharing this information with us. Waiting for more updates from this blog admin.
ReplyDeletegst training in chennai
Angularjs Training in Chennai
CCNA Training in Chennai
salesforce training institute in chennai
ui design course in chennai
you have written an excellent blog.. keep sharing your knowledge...
ReplyDeleteJMeter Training in Chennai
JMeter Certification
ReplyDeleteAwesome blog. Thanks for sharing such a worthy information....
Angularjs Training in Bangalore
Angularjs classes in pune
Angularjs Training in hyderabad
Angularjs Training in Gurgaon
Angularjs Training in delhi
Angular Training in Trivandrum
Angular Training in Kochi
Angularjs Training in Ahmedabad
Angularjs Training in Kolkata
Best AngularJS classes in Mumbai
Informative blog and knowledgeable content.
ReplyDeleteUI Development Training in Hyderabad
RPA Training in Hyderabad
Python Training in Hyderabad
Mean Stack Development Training in Hyderabad
Thanks for sharing a valuable blog with us. Informative and useful content to many people.
ReplyDeleteUI Development Training in Hyderabad
RPA Training in Hyderabad
Python Training in Hyderabad
Mean Stack Developer Training in Hyderabad