As explained in one of my previous posts, web_reg_save_param is THE most important function when you are working with LoadRunner. We will start with the syntax and then touch upon some examples to get a clear idea.
int web_reg_save_param (const char *mpszParamName, <List of Attributes>,LAST);
Find below the available attributes [<List Of Attributes>]. Note that the attribute value strings (e.g. Search=all) are not case sensitive.
NotFound The handling method when a boundary is not found and an empty string is generated. “ERROR,” the default, indicates that VuGen should issue an error when a boundary is not found. When set to “EMPTY,” no error message is issued and script execution continues. Note that if Continue on Error is enabled for the script, then even when NOTFOUND is set to “ERROR,” the script continues when the boundary is not found, but it writes an error message to the Extended log file.
LB The left boundary of the parameter or the dynamic data. This parameter must be a non-empty, null-terminated character string. Boundary parameters are case sensitive; to ignore the case, add “/IC” after the boundary. Specify “/BIN” after the boundary to specify binary data.
RB The right boundary of the parameter or the dynamic data. This parameter must be a non-empty, null-terminated character string. Boundary parameters are case sensitive; to ignore the case, add “/IC” after the boundary. Specify “/BIN” after the boundary to specify binary data.
RelFrameID The hierarchy level of the HTML page relative to the requested URL.
Search The scope of the search—where to search for the delimited data. The possible values are Headers (search only the headers), Body (search only Body data, not headers), or ALL (search Body and headers). The default value is ALL.
ORD This optional parameter indicates the ordinal or occurrence number of the match. The default ordinal is 1. If you specify “All,” it saves the parameter values in an array.
SaveOffset 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.
Savelen The length of a sub-string of the found value, from the specified offset, to save to the parameter. The default is -1, indicating until the end of the string.
Convert The conversion method to apply to the data:
HTML_TO_URL: convert HTML-encoded data to a URL-encoded data format
HTML_TO_TEXT: convert HTML-encoded data to plain text format
Examples:
The examples below are taken from the LoadRunner tutorial to give clarity on topic. We will see more examples in the coming posts.
Sample Correlation for Web Vusers
Suppose the script contains a dynamic session ID:
web_url(“FirstTimeVisitors”,”URL=/exec/obidos/subst/help/first-time-visitors.html/002-8481703-4784428>Buy books for a penny “, “TargetFrame=”,”RecContentType=text/html”,”SupportFrames=0″,LAST);
The dynamic id here is 002-8481703-4784428
You insert a web_reg_save_param statement before the above statement:
web_req_save_param (“user_access_number”, “NOTFOUND=ERROR”,”LB=first-time-visitors.html/”,”RB=>Buy books for a penny”, “ORD=6″,LAST);
ORD=6 saves the sixth occurrence of the value in user_access_number. I think everything else is self explanatory
After implementing correlated statements, the modified script looks like this, where user_access_number is the name of the parameter representing the dynamic data.
web_url(“FirstTImeVisitors”,”URL=/exec/obidos/subst/help/first-time-”“visitors.html/{user_access_number}Buy books for a penny “,
“TargetFrame=”,”RecContentType=text/html”,”SupportFrames=0″,LAST);
Note: Each correlation function retrieves dynamic data once, for the subsequent HTTP request. If another HTTP request at a later point in the script generates new dynamic data, you must insert another correlation function.
Also as I wrote in my last post don’t confuse correlation with parameter which you might have used in tools like QTP to pass varying values. Parameter is not a dynamic value captured from server response but it is something for which the user has predefined data values available.
Tips to identify the dynamic string boundaries:
- Always analyze the location of the dynamic data within the HTML code itself, and not in the recorded script.
- Identify the string that is immediately to the left of the dynamic data. This string defines the left boundary of the dynamic data.
- Identify the string that is immediately to the right of the dynamic data. This string defines the right boundary of the dynamic data.
- web_reg_save_param looks for the characters between (but not including) the specified boundaries and saves the information beginning one byte after the left boundary and ending one byte before the right boundary. web_reg_save_param does not support embedded boundary characters.
For example, if the input buffer is {a{b{c} and “{” is specified as a left boundary, and “}” as a right boundary, the first instance is c and there are no further instances—it found the right and left boundaries but it does not allow embedded boundaries, so “c” is the only valid match. By default, the maximum length of any boundary string is 256 characters.
Include a web_set_max_html_param_len function in your script to increase the maximum permitted length. For example, the following function increases the maximum length to 1024 characters: web_set_max_html_param_len(“1024”);







initiative
Hi,
I’ve a doubt here. In my sripts i’ve identified the dynamic value and tried correlation. The issue i faced here is the same dynamic values present with differnt boundary values. Do i need to include different functiona for earch or shall i use the same function throught out.
Posted by Senthil | June 17, 2008, 1:23 pmdynamic boundaries with different boundary values…Can you elaborate more on this?
probably you can consider using DIG flag in WRSP
Posted by Ankur | June 17, 2008, 2:31 pmAdding more to comments 2:
I’m working on a banking application, where the script has generated an dynamic value in the login page with different boundaries. The same values appears in across the page with different boundaries. I got confused with this. I tried different correlation for all the values.
Please let me know if you need more clarification.
Posted by senthilkumar.v | June 17, 2008, 9:06 pmwell, I was looking for the boundaries you were getting.
anyways, can you show me the code? Please ensure proper formatting.
Posted by Ankur | June 17, 2008, 9:28 pmSorry i don’t av the code. Let me update you tomorrow.
Posted by senthilkumar.v | June 17, 2008, 10:26 pmPlease can anyone suggest me good training centers for Load Runner in Bangalore
Posted by aravind | August 6, 2008, 1:10 pmHello.
I am facing some problem to dealt with Correlation.
The dynamic value is not present in the server response of any of the previous request in generation log.
Can any body explain me how to get it’s boundry whwn u r not recieving these dynamic valuse in the previous request.
Posted by Sumit Arneja | September 1, 2008, 8:14 pmsenthilkumar:
Fine following link ….you mat get solution for your question.
http://motevich.blogspot.com/2007/10/loadrunner-scripts-correlation-tutorial.html
Posted by lrperftest | September 11, 2008, 11:30 pmhi,
let me know how to find the dynamic values in winsock vuser script.
Posted by praveen | April 27, 2009, 9:30 amHi ,
abouve information is very useful , thanks for that
if anybody (Beginners) need help , can post quires to following id
rajasekhar.thallapaka@in.ispace.com
or can contact to 09000890326.
regards,
rajasekhar.T
Posted by Rajasekhar | April 28, 2009, 2:28 pmI want to know when we use LB or RB as LB/IC or RB/DIG ?
Also can you please inform me if there is any other such kind of things.
It would be help full if I have a list of these.
Posted by Nilanjan ghosh | September 4, 2009, 11:53 amhello,
In the function web_reg_save_param can we have a variable value for “SaveLen” parameter
like SaveLen>8
That is, those values with length greater than 8
Posted by Ajay Saini | October 30, 2009, 9:55 amIs there a way to capture the high/low values of an array? I have no problem using the web_reg_save_param function, but once I have the array of data I need to isolate the lowest value in that array. Is there a simple way to do this?
Thanks.
Posted by Martin | July 9, 2010, 1:05 amhow to set special characters as left or right boundaries.
Posted by sunkara | July 31, 2010, 2:08 amHi,
Could some one help me !
I am facing the below issue.
My application is web application.I am using LR 9.2 and IE8 , OS as Windows XP.
When I replay the script i got the error as Action.c(44): Error -26226: Button not found [MsgId: MERR-26226].
web_button(“BUTTON”,
“Snapshot=t4.inf”,
DESCRIPTION,
“Type=submit”,
“Tag=BUTTON”,
“ID=pt1:r1:0:pt1:j_id__ctru16j_id_0″,
ACTION,
“UserAction=Click”,
LAST);
Could you please help me to fix this issue.
What funtion do i need to add to resolve this issue.
And also will you please tell me how to post questions on learnloadrunner.com blog
Thanks in advance!
Thanks,
Raj
Posted by Raj | December 16, 2010, 1:49 amHi All,
I am a beginner in this loadtesting arena.
And i have a query to clarify.
As you know, Using “ORD=ALL” saves the multiple occurences of a dynamic value with the same left boundary and right boundary in an array.
Say for example if I save the varibale name as Session_ID.
And if i need to use the 1st or 2nd occurence, I can replace the value as {Session_ID_1} and {Session_ID_2}.
This case is working fine for me.
But when i tried to access 4th and 5th occurence I get a warning message
“Warning: The string ‘Session_ID_4′ with parameter delimiters is not a parameter”
Is there any way to handle multiple occurences of a single variable having same boundaries ?
Please Help me people !!
Thanks in advance !!
Posted by Prem Kumar | January 16, 2011, 5:49 pmFirst see what is Session_ID_Count, don’t try to access those things which are not saved.
Your probem may be related to the listing of something: When you record for some data you might have had 5 records, but for other searches if only 2 or 3 displayed, 2 or 3 values are saved to array. Thats why if you want to use in for loop, first save no. of matches to integer variable.
int N = atoi(lr_eval_string(“Session_ID_Count”);
Posted by Manjunatha Prabhu | February 10, 2011, 10:15 pmchar dummy[20];
for (i=1;i<=N,i++)
{
sprintf("dummy", lr_eval_string("{Session_ID_%d}"),i);
}
Posted by Manjunatha Prabhu | February 10, 2011, 10:19 pmHi,
Does any body has any idea on,
Does HP Loadrunner supports Oracle ADF Framework applicatons?
Thanks,
Raj
Posted by Raj | February 10, 2011, 10:47 pmWhat is the Use of “LAST” attribute in Web_reg_save_param() in Loadrunner.
Posted by Prabhu | February 18, 2011, 1:48 pmHi Ankur,
Nice article
I think in your example there is a prob.you forgot to include < .
web_url(“FirstTImeVisitors”,”URL=/exec/obidos/subst/help/first-time-”“visitors.html/{user_access_number}Buy books for a penny “,
“TargetFrame=”,”RecContentType=text/html”,”SupportFrames=0″,LAST);
after inserting the variable you have to include <
Should be like this.
web_url(“FirstTImeVisitors”,”URL=/exec/obidos/subst/help/first-time-”“visitors.html/{user_access_number}<Buy books for a penny “,
“TargetFrame=”,”RecContentType=text/html”,”SupportFrames=0″,LAST);
may be i am wrong please correct me.
Posted by Rajiv | May 28, 2011, 4:11 pmI Need 1 help in Web_Reg_save_param..
I have a left and right boundary in wic many values going to occur.
I can capture it using ORD=all
But i need the index of particular occurance.
I am unable to find it.
example:
Leftboundary button=true rightboundary
Leftboundary button=true rightboundary
Leftboundary button=false rightboundary
Leftboundary button=true rightboundary
Leftboundary button=true rightboundary
Leftboundary button=false rightboundary
I want to find the index of “Leftboundary button=false rightboundary”
Posted by Manish J Shettigat | June 17, 2011, 5:53 pmHi,
Can anyone help me out in knowing in how to increase the limit of “length of the correlated values” while using auto correlation rules.
I have an idea that it could be increased by editing the limit in corr file which is uasally available in the C drive, but I am not sure where this file actuallly lies in the system.
Any idea…!!!
Posted by Arun Kumar | October 5, 2011, 1:56 pmHi Guys,
I want to define the value for RB and LB as follow for the request data,
l_billerid=”AL1″;
i have given
web_reg_save_param(“P_billID”,”LB=l_billerid=”",”RB=”;\n”,”ORD=ALL”,LAST);
But am getting error in the syntax due extra the Double Quotes in the LB and RB . How to solve this please help me. Note : I dont want to change the -_biller=”AL1″
Posted by Prasath | January 5, 2012, 9:44 amI need to capture slash in the boundary but slash is a delimiter in web reg save param.
please tell me how to handle it
example
value=FYF Gold Delta Business Card\ avalue;
left boundary is =value=
rightboundary is =\ avalue;
but value is not getting captured as \ is a delimiter
Posted by Manish | January 12, 2012, 10:40 amHi,
I have a doubt in Paramaterizing the script that I recorded where it filters messages, while I choose a Message catergory and date.
I see that the POST method recalls the message category again twice,
Do I need to parameterize all the occurances of the message category with the same parameter list/file?
Posted by anu | January 19, 2012, 6:26 pmcan ne1 tell me where the dynamic values are saved???
Posted by amit | February 21, 2012, 12:25 amI have a question regarding the LB and RB in correlation part in Load Runner.
If the LB and RB is keep on changing can we correlate ? If yes den how ? If any one can explain with example that will be great.!!!!!!!!!
Posted by prashant | February 23, 2012, 4:20 pm