VuGen: Correlation With Dynamic Boundaries
Posted on Jun, 2012 by Admin
Even though the web_reg_save_param function was deprecated in the Vugen function reference and “readme” file for LoadRunner 11, please note that the NEW function, web_reg_save_param_ex is NOT what is automatically used by Vugen to correlate data during recording (in a case where you might have the Correlation Studio working to auto-correlate) for the web/http protocol. It still uses web_reg_save_param. As per the function reference, you will have to code web_reg_save_param_ex in manually.
If you attempt to take a script with web_reg_save_param_ex in it and load it into SiteScope to have it run a web script monitor, it won’t understand what a web_reg_save_param_ex is, and it will bomb. I know this is true up to SiteScope 11.0, but I have not tried later versions.
Since web_reg_save_param is still around, let’s use it to capture something where the left and right sides are always changing? In this example, 5 iterations have the following strings and you need to correlate it:
We’ll need to account for the fact that the left side of the name pairs could be any number on the left of the equal sign, as well as the right hand side being totally random characters. To capture what we need, we can use either the DIG flag or SaveOffset attribute. Use the DIG flag in left and right boundaries. This functionality is available in LR 7.6/7.8. DIG flag replaces all digits with the character #. This allows you to detect matches when the all of the characters, other than the numbers are the same
web_reg_save_param("param", "LB/DIG=userhandle#=", "RB=/r/n", LAST);
The SaveOffset attribute functionality is available in LoadRunner as of version 7.8. This attribute allows us to set the offset of a sub-string of the found value, to save to the parameter. The default is 0. The offset value must be non-negative.
web_reg_save_param("param", "LB=userhandle", "RB=/r/n", "SaveOffset=2", LAST);