Sunday, July 7, 2013

How to correlate a Winsock script in LoadRunner

For LoadRunner 7.51 and later, users can correlate the dynamic value for a Winsock script from VuGen's Tree View. Below is further information on how it can be accomplished.
In LoadRunner, to use the Tree View for correlation:
  1. Open the script in VuGen.
  2. Choose View > Tree View.
  3. The Tree View will open with the following structure: 
Function call in the LoadRunner script listed on the left panel.
Snapshot of the page in the right panel which can be viewed in either Text View or Binary View
To correlate in LoadRunner:

Select the lrs_recieve function on the left panel of the Tree View. The contents of the received buffer are displayed in the right panel.
Select either Text View or Binary View. If you work in Text View, you need to clear the Read-only check box in the upper right corner.
Search for the dynamic value that you want to capture.

Highlight that value, right-click, and select Create Parameter. There are two ways to create a parameter: 

If the offset of the dynamic value is fixed, highlighting that value will set the correct values forData Range in the Create Parameter window. This creates the function lrs_save_param.
If the offset values are not fixed (when the send buffer is parameterized and the response of the server changes in length), look for fixed left and right boundaries to capture the value. Then check Extract Parameter data using boundaries and set the left and right boundaries correctly. This creates function lrs_save_search_string.

VuGen will pop-up with an option for applying the correlation to all occurrences of the value in the script.
If you select Yes, VuGen will automatically search for this value in all the lrs_send buffers and replace the values with the parameter name.
If you select No, the correlation will be applied to the current location only.

Recording Problems in LoadRunner

Here, I’m going to describe some common recording problems / issues of Load Runner and how to resolve them. Normally, these problems are faced by everyone. I would request you all that leave your comments for the problems you face and how you tackle them.

  1. Firefox is not supported: Only Internet Explorer is supported for Web (Click and Script). To record browser activity on Firefox, use the Web (HTTP/HTML) protocol.
  2. Application behaves differently while being recorded: If your application behaves differently during recording, than it does without recording, you should determine if the recording problem is unique to Web (Click and Script). The effect may be that a Web page will not load, part of the content is missing, a popup window does not open, and so forth. Create a new Web (HTTP/HTML) script and repeat the recording. In the event that the recording is OK in Web (HTTP/HTML), we recommend that you disable socket level recording. The problem may be the result of an event listener. Use trial and error to disable event listeners in the Web Event Configuration Recording Options, and then re-record your session as a Web (Click and Script) user. To disable an event listener:
    • Open the Recording Options. Select Tools > Recording Options and select the GUI Properties:Web Event Configuration node.
    • Click Custom Settings and expand the Web Objects node. Select an object.
    • Select Disabled from the list in the Record column for the relevant Web object. If the recording still does not work, enable the listener you previously disabled, and try disabling another one. Repeat these steps until your recording succeeds.
  3. Dynamic menu navigation was not recorded: A dynamic menu is a menu that dynamically changes depending on where you select it. If the dynamic menu navigation was not recorded, record again using "high" event configuration mode. To set the configuration level to high:
    • Open the Recording Options. Select Tools > Recording Options and select the GUI Properties:Web Event Configuration node.
    • Move the slider to High.
  4. Certain user actions were not recorded: Check if there is a Java applet running inside the browser. If not, record the script with the Web (HTTP/HTML) protocol.