web_reg_save_param

web_reg_save_param

The LoadRunner function “web_reg_save_param” is used to manage the dynamic values returned by the server in the response. The ‘Correlation – Overview’ article has already discussed the fundamental idea of dynamic value. As you continued, you learned about the several types of correlation, including autocorrelation and manual correlation.

When you select the ‘Correlate’ button to use the dynamic value provided by Autocorrelation, VuGen adds the ‘web_reg_save_param’ function to the script. To ensure that LoadRunner captures the dynamic value from the response and feeds it to the subsequent requests, manual correlation requires that you manually implement the same function at the appropriate location.

Why does the function name look this way?

The use of the “web_reg_save_param” function is for the web protocol (abbreviated “web”). By using the “reg” symbol, this function registers a request to determine the dynamic value depending on the boundaries. The dynamic value must then be saved in a parameter (indicated by “save_param” words) after the request has been registered. This is why it is called “web_reg_save_param.”

To access the web_reg_save_param input box, use the navigation:

  • ‘Ctrl+Alt+B’ or ‘View -> Steps’ will be required. Toolbox
  • ‘web_reg_save_param’ should be typed into the search field. VuGen will display the content that matches.
  • The ‘web_reg_save_param’ function should be double-clicked. The following inputs will be available in the window:
web_reg_save_param

                                                Figure(1)

‘web_reg_save_param’ has the following characteristics:

  1. Parameter Name: Name of the correlation parameter to be used to store the dynamic value. This field must be filled out.
  2. Left Boundary (LB): This symbol stands for the dynamic value’s left boundary. It uses all of the characters from the beginning of the data as a boundary if you do not give an LB value. This quality is required.
  3. Right Boundary (RB): It designates the dynamic value’s right boundary. To ensure that LoadRunner captures the correct dynamic value, the left and right boundary pair must be distinct. It uses all characters up until the end of the data as a boundary if you do not specify an RB value. This quality is required.
    In addition to the border text, the LB and RB properties feature several text flags that aid in customizing and refining the search:
    • Match case (/IC): To consider or ignore the case
    • Binary data (/BIN): To specify the binary data for boundaries
    • Use # for any digit (/DIG): Wildcard for digits
    • Use ^ as a wildcard for (all, lowercase, uppercase) alphanumerical characters
      • all (ALNUMIC): To ignore the case
      • lowercase (ALNUMLC): To match the lowercase only
      • uppercase (ALNUMUC): To match the upper case only
  4. Instance (ORD): This attribute is optional. It’s used to record dynamic values for a particular occurrence. All occurrences of the matching boundary are kept in an array if you set the value of Instance (ORD) = All. The ParamName_index identifies each element of the array individually. The parameter name in the example below is c_custID:

    web_reg_save_param(“c_custID”,
    “LB=customerID=”,
    “RB=;”,
    “Ord=All”,
    LAST);


    The c_custID_1 value is saved for the first match, the c_custID_2 value for the second match, and so on. Using the ParamName_count argument, you may get the total number of matches. For instance, you can use the following sentence to retrieve the total number of matches saved to the parameter array:
  5. Relative Frame ID (RelFrameID): This attribute is optional. The HTML page’s position In the hierarchy with respect to the requested URL. Both ‘All’ and a number are viable options.

    customerCount=atoi(lr_eval_string(“{c_custID_count}”));
  6. Not Found (NotFound): This attribute has the default value of “NotFound=error” and is optional. When the defined boundary does not match, this option responds by producing an empty string. The following input methods are available:
    • ERROR: This is a default value. When a boundary is not found then LoadRunner highlights it as an error in the log.
    • WARNING: LoadRunner does not issue an error. If the boundary is not found, it sets the parameter count to 0 and continues executing the script. The “warning” option is good when you want to see whether the string was found or not, but do not want the script to fail.
  7. Search in (Search): This optional parameter has the value “All” by default. where to look for the delimited data within the search’s scope. Possible values include:
    • All: The scope of the search is body, headers, and resources 
    • Headers: It indicates to search only in the headers
    • Body: The scope of the search is only body, not headers
    • NoResource: The scope of the search is only the HTML body, excluding all headers and resources
  8. Save Length (SaveLen): This parameter is optional. Determining the string’s length starting at the appropriate offset before saving it to the parameter is helpful. By default, the string is stored from offset to end, which is set to -1.
  9. Store Offset – The default value of this attribute is 0 (zero) and is optional. Use the offset option to store part of the dynamic value in the parameter. A non-negative offset value is required.
  10. IgnoreRedirections – This is an optional attribute with a default value of “No”. The possible values are:
    • Yes: By setting the ‘IgnoreRedirections=Yes’, it instructs LoadRunner not to search the dynamic value in the response of the redirected request. You can identify the redirected request by its response code HTTP 3XX.
    • No: LoadRunner even searches for the existence of dynamic value in the response of the redirected request.
  11. Conversion: This quality is optional. The possible values are:
    • HTML_TO_URL: convert HTML–encoded data to a URL–encoded data format
    • HTML_TO_TEXT: convert HTML–encoded data to plain text format

Example: For example, ‘web_reg_save_param’. with all the features

https://www.perfmatrix.com/wp-content/uploads/2019/12/web_reg_save_param_toolbox.png

                                                            Figure (2)

web_reg_save_param(“c_custID”,

“LB/BIN/DIG/ALNUMIC=clientID=”,

“RB/BIN/DIG/ALNUMIC=;”,

“Order=1”,

“Save Offset=2”,

“SaveLen=8”,

“Not found=ERROR”,

“Search=Main”,

“RelFrameId=1”,

“IgnoreRedirects=Yes”,

LAST);

How does the script’s web_reg_save_param function work?

  1. Determine the dynamic value of the script (how?)
  2. Look for the requested cursor so that you can see the dynamic value of the response.
  3. Right-click and select “Insert”, “New Step”, and Step Tools -> (Enter a keyword) Double-click web_reg_save_param to open the WebRegSave parameter A dialog box titled “Save data to a parameter”. Enter the necessary information and then click “OK”.

EITHER

You can easily write the script if you are familiar with the correct syntax and features of the web_reg_save_param function.

LoadRunner also has four additional mapping functions. Click on the following link for more information:

  • web_reg_save_param_ex
  • web_reg_save_param_regexp
  • web_reg_save_param_xpath
  • web_reg_save_param_json
  • web_reg_save_param_attrib
Scroll to Top