Manual Correlation

Manual LoadRunner mapping

As we continue our discussion of mapping, we now come to manual mapping. In my previous blogs, I have covered the basics of correlation and autocorrelation. Manual mapping is a technique for locating dynamic values that require manual work. When using automatic mapping, dynamic values can occasionally be 100% bound (this is a general statement that does not apply to all protocols). Rule-based autocorrelation identifies dynamic values based on established rules. But sometimes the established rules fail to distinguish dynamic values because they do not meet the correlation criteria. In that situation, manual mapping of dynamic values in LoadRunner is required.

If you use autocorrelation to troubleshoot the script using one of the methods (Rule, Record, and Play) and the script still doesn’t work, it follows that you must manually identify the dynamic values that are at fault.

There are two ways to perform manual mapping in LoadRunner and they are as follows:

  • When comparing two scripts for the same stream using WDiff
  • Use and reproduce the generation log

A. Script Comparison:

The first technique compares two scripts with the same stream, captures the differences in values, and correlates them by adding a correlation function. This procedure requires recording the same script twice and comparing the two scripts.

In VuGen, LoadRunner provides a tool called “WDiff” that helps compare script text and highlight differences.

LoadRunner Manual Correlation - Script Comparison

                                                    Figure 1

How can I use LoadRunner to compare two identical stream scripts to determine dynamic values?

  1. Create a script and name it script_main before saving it.
  2. Record the same flow with another script and save it as child_script.
  3. Choose “Select a folder to compare” or “Compare with a remote folder” in Tools -> Compare. The peculiarities of the script are underlined (in yellow).
  4. Examine the variations and decide which dynamic value to map.
  5. Find the string that is right next to the dynamic data. The left edge of the dynamic data is defined by this string.
  6. Find the string immediately to the right of the dynamic data. The right edge of the dynamic data is defined by this string.

    To help you find the strings more easily, the left and right limits should be as different as possible. Type a unique token to capture the dynamic value if you are comfortable using regular expressions.

  7. Right-click the script for the step or function that contains the dynamic data.
  8. Click New Step

OR

Press β€˜AltΒ + Insert’

LoadRunner Manual Correlation - Adding correlation Function

                                                    Figure 2

9. The “Steps Toolbox” will appear on the right.

LoadRunner Manual Correlation - Step Toolbox

                                                    Figure 3

10. Type “web_reg_save_param” in the search bar and click on it.

https://www.perfmatrix.com/wp-content/uploads/2019/12/LoadRunner-Correlation-Manual-Step-Toolbox-Search.png

                                                    Figure 4

11. Enter the parameter name, left limit, and right limit, and save the offset if necessary.

LoadRunner Manual Correlation - web_reg_save_param

                                                    Figure 5

12. Click “OK”. Your script contains the mapping function.

https://www.perfmatrix.com/wp-content/uploads/2019/12/LoadRunner-Correlation-Manual-Function-Added.png

                                   figure(6)

B.Β Via Replay/Generation Log:Β 

In this method, you need to find and compare the dynamic values in the recursion register and the generation. You should use correlation if the values are different. You may need to find and compare hash strings, random strings, session IDs, the current date and time, etc. Follow the instructions below to use this technique:

  • Runtime Configuration -> Logging -> Extensive logging can be used to reproduce the script.
  • A problem with dynamic values can cause the script to crash
  • Find the values of the dynamic parameters specified in the request and copy the corresponding parameter name (or HTML tag).
  • If the response in the generation log contains a different string within the same boundaries as the original suspected string then the string requires correlation.
  • Repeat steps 5 through 8 to add the map function to the script.
Scroll to Top