How to Correlate Scripts - Web (Manually)

  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

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

    3. Identify Patterns using XPath or JSONPath expressions

    4. Use the snapshot pane to manually search for the XPath of the desired 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 into the script before the statement that contains the dynamic data.

    1. web_reg_save_param_ex

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

    3. web_reg_save_param_xpath

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

    5. web_reg_save_param_json

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

Back to top