Share this page

# Web manual correlation in code

This task describes how to correlate web scripts manually by modifying the code.

To manually correlate a script:

1. Locate the string and its details

   Identify the statement that contains dynamic data and the patterns that characterize the locations of the data. These patterns may be boundaries or xpaths.

   1. Identify Patterns using Boundaries

   Use these guidelines to determine and set the boundaries of the dynamic data:

   - Analyze the location of the dynamic data within the HTTP response.

   - 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.

   - The right and left boundaries should be as unique as possible to better locate the strings.

   - web_reg_save_param_ex 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_ex 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:

   These length restrictions do not apply where either the left or right boundaries are blank.

   2. Identify Patterns using XPath or JSON Path expressions

   Use the snapshot pane to manually search for the XPath of the required string.

   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:

   These length restrictions do not apply where either the left or right boundaries are blank.

2. Add web_reg_save_param_* function

   Add a web_reg_save_param_* function into the script before the statement that contains the dynamic data.

   Item | Description
   --- | ---
   web_reg_save_param_ex | This function searches server responses in web steps for the left boundary following by the string and the right boundary and saves the string to a parameter named in the function's argument. After finding the specified number of occurrences, web_reg_save_param_ex does not search any more responses. For more information, see the Function Reference.
   web_reg_save_param_xpath | This function searches server responses in web steps for a specified XPath. The string located in specified XPath is saved to a parameter named in the function's argument. For more information, see the Function Reference.
   web_reg_save_param_json | This function searches server responses in web steps for a specified JSONPath. The located string is saved to a parameter named in the function's argument. For more information, see the Function Reference and Internet resources for JSONPath, XPath for JSON.

3. Replace data with parameter

   Select Edit > Replace from the VuGen main window to display the Search and Replace dialog box. Search the entire script for the dynamic data and replace it with a parameter. Give the parameter any name and enclose it with braces:`{param_name}.` You can include a maximum of 64 parameters per script.

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1-26.3 All View Local Help Center View Online Help Center Version: