VuGen: Correlation With Dynamic Boundaries

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:

userhandle1=001ABC
userhandle2=002DEF
userhandle3=003AAA
userhandle4=004bbb
userhandle5=005ccc

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

EXAMPLE:

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.

EXAMPLE:

web_reg_save_param("param", "LB=userhandle", "RB=/r/n", "SaveOffset=2", LAST);

What's Next?

Did you enjoy this article? Help spread the word by sharing:

Join the Northway Navigator Club today and get access to restricted content including our best tips and tricks. Membership is free! You will also receive free email updates by registering.

Engage in the conversation and leave a comment:

Scott Moore

About Scott Moore (153 articles)

With over 20 years of IT experience with various platforms and technologies, Scott has tested some of the largest applications and infrastructures in the world. He is a Certified Instructor and Certified Product Consultant in HP’s LoadRunner and Performance Center products. He currently holds HP certifications for ASE, ASC, and CI. A thought leader in the APM space, he speaks regularly at IT conferences and events



  • Chandu

    How to correlate a string with dynamic boundaries and of “varying length”. ?

    For E.g.: In the below server return , the string to correlate is “month-FY##” , (say “January – FY12″ ) and the month is obviously dynamic in length.

    January – FY12

    and this does not come for rescue as it only captures September every time

    web_reg_save_param(“month”,”LB/ALNUMIC=”,”RB=”, “ord=all”, LAST);

    any idea??

    Thanks,
    Chandu

    “In the God we Trust, rest we Test…”