Dealing with Dynamic Boundary Parsing
In LoadRunner , we generally hear the term Correlation(Correlation is nothing but capturing dynamic data from the server response to be used as input in further requests).
We generally deal with dynamic data remember not dynamic boundary using following in build function,modify the function as below to include the /IC flag:
.
For Ex---
But now question arises that what should we do if data boundary is dynamic??
Here is the solution for that
Suppose you have the response data as follows, where you are Capturing the string but issue is that the left boundary is always get changing every time. You get the left boundary as Head1,Head2,Head3........HeadX and so on, where X ranges between 0 and 9, as follows:
Head1=Captured data rb
Head2=Captured data rb
Head3=Captured data rb
——–
——–
Head9=Captured data rb
You can capture the desired string by putting the following correlation function in place, using the /DIG text flag in combination with LB:
web_reg_save_param(“DynamicCapture”, “LB/DIG=Head#\=”, “RB=rb”, LAST);
If Digits are changing case,
The corresponding place, which you expect to be dynamically filled in with a digit, should be replaced by a pound sign ( # ).
For mulitple Digit you can replace that digit with muliple #### sign,
Head123=Captured data rb
web_reg_save_param(“DynamicCapture”, “LB/IC/DIG=Head###\=”, “RB/IC=rb”, LAST);
If letters are changing case,
Modify the function as below to include the /IC flag:
web_reg_save_param(“DynamicCapture”, “LB/IC/DIG=a#b\=”, “RB/IC=rb”, LAST);
If digit or a letter are changing case,
Modify the function to use /ALNUM instead of /DIG text flag, and use caret sign(^) instead of # :
web_reg_save_param(“DynamicCapture”, “LB/ALNUM=Head^\=”, “RB/IC=rb”, LAST);
Keep in mind two things:
1.One sign (# or ^) for each place
2.If you have a literal # or ^ sign, it will not be interpreted as a literal, if you use the corresponding flags. E.g. LB/DIG=Head# will not match “Head#”
2.If you have a literal # or ^ sign, it will not be interpreted as a literal, if you use the corresponding flags. E.g. LB/DIG=Head# will not match “Head#”
No comments:
Post a Comment