Get Knowledge from Video instead of Content:

Monday 30 January 2017

JMeter - PreProcessor - "RegEx User Parameters"

I do not find any practical use of "RegEx User Parameters". It is stated in the Apache JMeter guide that 

RegEx User Parameter allows to specify the dynamic values for HTTP parameters extracted from another HTTP Request using regular expressions. RegEx User Parameters are specific to individual threads.

If you extract the value from the response and store in the variable then each RegEx value is stored in a separate variable. These variables can be called by using the index value and parameter group number. The parameter index value and group number form a unique identity for each dynamic value. Let's try to understand with an example. The below-given screenshot having 3 transactions and each transaction has 1 request. 
The first request (01 Request) having Regular Expression Extractor and extract the multiple dynamic values from the response of the same page.
As an output, 14 strings are matched. Each string has 2  dynamic values, so we got 28 values. 
In the above-screenshot, see myVarName_5:
myVarName_5=mercurycruisece71665d934a23ce63ed0e275e809934
myVarName_5_g=2
myVarName_5_g0=<a href="mercurycruise.php?osCsid=ce71665d934a23ce63ed0e275e809934"
myVarName_5_g1=mercurycruise
myVarName_5_g2=ce71665d934a23ce63ed0e275e809934
The first parameter "myVarName_5" shows all the dynamic values. You may not differentiate between extracted values because there is no separation between them. 
The second row "myVarName_5_g" denotes how many groups are formed? In our example, there are 2 groups created. 
The third parameter "myVarName_5_g0" has the value of full string which is used to extract the desired value. 
The next parameter list "myVarName_5_g<n>" represents the extracted dynamic values. "myVarName" is a variable name, "5" represents parameter index number and g<n> represents the group number under particular index. 
Now, if I run the test using "RegEx User Parameter" then it does not replace the value.

Instead of that if I use index number and group number then samplers are passed.
Kindly let me know if someone really understands the purpose of RegEx User Parameters. Please write your comments in the comment section or email me @ gd.performance.tester@gmail.com  
That's the end of Apache JMeter PreProcessor. 


Previous Topic:
Apache JMeter - "User Parameters" Element

Related Topics:

No comments :

Post a Comment