web_reg_save_param_ex

web_reg_save_param_ex

web_reg_save_param function is deprecated from 12.5 version of Loadrunner. Therefore web_reg_save_param_ex and web_reg_save_param_xpath is introduced. Here we will see about web_reg_save_param_ex function and its attributes.

 Syntax :

web_reg_save_param_ex("ParamName=<output parameter name>", [LB[/IC][BIN]=<value>, ][RB[/IC][BIN]=<value>, ] <List of Attributes>, <SEARCH FILTERS>,LAST );

Example : 

web_reg_save_parama_ex

Most important list of attributes present in the function.

ParamName:

  • It store the dynamic values in the specified variable which is found using the attribute.

LB:

  • Left boundary of the dynamic value which we need to capture.
  • If the LB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

RB:

  • Right boundary of the dynamic value which we need to capture.
  • If the RB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

List of Attributes :

Most important attributes used in this section.

  • ORD:
    • It will Indicates the ordinal position of the dynamic value or instance of the match of the value.
    • If you specify as "All," it saves the parameter values in an array.
    • Default value of the instance is 1.
    • This attribute is optional.
  • NOTFOUND :
    • It used to handle when the boundary is empty string in the response.
    • "Not found=error" is the the default value. It will raise the error when a boundary is not found.
    • "Not found=warning" does not raise an error. Therefore "warning" option is ideal if you want to see if the string was found and you do not want the script to fail.
    • This attribute is optional as well.
  • SaveLen :
    • Length of the sub-string where the value is found, from the specified offset, to save into parameter.
    • Default value is -1, indicating to save to the end of the string.
    • This attribute is optional.
  • SaveOffset:
    • Offset of a sub-string where the value is found, to save into parameter.
    • Value must be non-negative.
    • Default value is 0.
    • This attribute is optional.

SEARCH_FILTERS :

Search Filters starts with the marker that is SEARCH_FILTERS. The SEARCH_FILTERS section is option, therefore we can use this when it is required only. Below are the most important specifiers used in this section.

  • ContentType:
    • Only responses with the specified ContentType header are searched.
    • Therefore this will search only the header section of the response.
    • The ContentType can contain the * wildcard.
  • HeaderNames:
    • We can give a list  of HTTP response header names with comma-separated.
    • Therefore only the specified headers' values are searched in the response.
    • It will be applied only when the Scope is "Headers".
    • If no Ordinal value is specified, the first occurrence of a match of the LB and RB is found.
  • Ignore Redirections:
    • If you set the attribute "Ignore Redirections=Yes", then if the server response contains any redirection information like (HTTP status code 300-303, 307). The response is not searched. Instead, once the redirection response is received, the GET request is sent to the redirected location. And the search is performed.
    • Therefore the default value is "Ignore Redirections=No".
    • This attribute is optional.
  • RelFrameID :
    • It specific the hierarchy level of the HTML page which is related to the requested URL.
    • Default value is ALL.
    • This attribute is optional.
  • RequestURL:
    • Only responses to this request are searched.
    • The URL can contain the * wildcard.
    • Therefore you can specif any wildcard in this section.
  • Scope:
    • Most important section is to specific where you need to search for the delimited data.
    • The possible values are:
      • All- Search the entire buffer.
      • Headers - Search only the headers.
      • Body - Search only body data.
      • Cookies - Search only in cookies.
    • This attribute is Optional.

web_reg_save_param Example

web_reg_save_param Example

Some of the examples which will cover the important attributes present in web_reg_save_param function.

Click Here to know about attributes of web_reg_save_param function.

Example 1:

<tr bgcolor=#66CCff><td align=center><input type = radio name=outboundFlight value=230;378;11/20/2003 checked >Blue Sky Air 230<td align=center>8am
<td align=center

  • We will see how we can capture the flight name which is highlighted in red color.
  • It will capture the values Blue Skg Air 230 in the C_Fightname parameter.
  • Ordinal is 1, which means the first occurrence of the value will be captured. Here the value Blue Skg Air 230 is the occurrence of the boundary.

web_reg_save_param("C_Fightname", "LB=checked >", "RB=<td align=center>", "ORD=1", LAST) ;

Example 2:

<tr bgcolor=#66CCff><td align=center><input type = radio name=outboundFlight value=230;378;11/20/2003 checked >Blue Sky Air 230<td align=center>8am
<td align=center

  • In this example, we will see how to use the Not Found and search attribute.
  • "Not Found = Warning" is specified in this example. Therefore when the response of the boundary is empty then the script will display warning but the script will stopped. But when you give as error then script will fail when the boundary values are empty.
  • Search is set "ALL" which means it will search every part of the response.

web_reg_save_param("C_Filghttime", "LB=name=outboundFlight value=", "RB=checked >", "ORD=1","NOTFOUND=Warning", "Search=ALL", LAST) ;

Example 3 :

  • In this example we will see how to use saveoffset, savelen and relframeid.
  • Savelen will save the length of the value.
  • Saveoffset will start the word as specific in the boundary.
  • Relframeid will let the boundary to search the frame where value might be found.

web_reg_save_param("C_Filghttime", "LB=name=outboundFlight value=", "RB=checked >", "SaveOffset=1", "SaveLen=1", LAST) ;

web_reg_save_param

web_reg_save_param

web_reg_save_param is the most important function used in load runner. It is used to capture the dynamic values sent by the server in the application and pass to the next request.

Syntax :

web_reg_save_param("Parameter_name", "LB=Left boundary", "RB=Right boundary", LAST);

These are the most important attributes of web_reg_save_param function which is used.

web_reg_save_param

Below are the list of all the attributes present in the function.

Parameter Name:

  • It store the dynamic values in the specified variable which is found using the attribute.

LB:

  • Left boundary of the dynamic value which we need to capture.
  • If the LB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

RB:

  • Right boundary of the dynamic value which we need to capture.
  • If the RB is empty, then it will capture all the characters from the starting of the boundary.
  • It is case sensitive, therefore when you are specific the boundary make sure they are exactly same as it is displayed.
  • One can further customize the search text, by using one or more text flags.
  • Its the most important attribute is mandatory.

ORD:

  • It will Indicates the ordinal position of the dynamic value or instance of the match of the value.
  • If you specify as "All," it saves the parameter values in an array.
  • Default value of the instance is 1.
  • This attribute is optional.

Search:

  • It specify where to search for the delimited value in the response.
  • It has different values such as.
    • Headers (Search only the headers).
    • Body (search only body data, not headers).
    • No resource (search only the HTML body, excluding all headers and resources).
    • ALL (search body, headers, and resources).
  • Importantly the default value is ALL.
  • This attribute is optional but generally preferred.

NOTFOUND :

  • It used to handle when the boundary is empty string in the response.
  • "Not found=error" is the the default value. It will raise the error when a boundary is not found.
  • "Not found=warning" does not raise an error. Therefore "warning" option is ideal if you want to see if the string was found and you do not want the script to fail.
  • This attribute is optional as well.

RelFrameID :

  • It specific the hierarchy level of the HTML page which is related to the requested URL.
  • Default value is ALL.
  • This attribute is optional.

SaveLen :

  • Length of the sub-string where the value is found, from the specified offset, to save into parameter.
  • Default value is -1, indicating to save to the end of the string.
  • This attribute is optional.

SaveOffset:

  • Offset of a sub-string where the value is found, to save into parameter.
  • Value must be non-negative.
  • Default value is 0.
  • This attribute is optional.

Ignore Redirections:

  • If you set the attribute "Ignore Redirections=Yes", then if the server response contains any redirection information like (HTTP status code 300-303, 307). The response is not searched. Instead, once the redirection response is received, the GET request is sent to the redirected location. And the search is performed.
  • Therefore the default value is "Ignore Redirections=No".
  • This attribute is optional.