LoadRunner

From wiki.vincentkong.com
Jump to: navigation, search

Contents

Recording a HTTP/HTML script

  1. Open Virtual User Generator
  2. Select Web (HTTP/HTML) protocol for web application recording
  3. Fill in the information in the dialog:
    Lr start recording.png
  4. Click OK to start recording

Record non HTML elements in separate steps

  1. In the Start Recording dialog box, click on the Options button.
  2. Under General » Recording, click on HTML Advanced button.
    Lr html base script.png
  3. Under Non HTML-generated elements..., check Record in separates steps and use concurrent groups checkbox.
    Lr advanced html script.png

Time transactions

In the recorded HTTP/HTML script:

  1. Select View Tree.
  2. Select the step to start timing the transaction and right click.
  3. Select Insert Before... from the pop-up menu.
    Lr insert step.png
  4. Select Start Transaction, and enter the transaction name.
    Lr start transaction.png
  5. Repeat the step for End Transaction

Manual Correlation

  1. Find dynamic value in the server response. e.g sessionId
  2. Highlight the value and right click.
  3. Select Create Parameter from pop-up menu.
    Lr create parameter.png

The additional code will be generated in the script:

// [WCSPARAM WCSParam_Text1 23 qwqKRbCJSDmXrvlD9z2sHOb] Parameter {WCSParam_Text1} created by Correlation Studio
web_reg_save_param("WCSParam_Text1",
    "LB=sessionId=",
    "RB='",
    "Ord=1",
    "RelFrameId=1",
    "Search=Body",
    "IgnoreRedirections=Yes",
    LAST);

The original value of sessionId will be replaced with {WCSParam_Text1}

web_submit_data("login.action",
    "Action=https://.../login.action",
    "Method=POST",
    "RecContentType=text/html",
    "Referer=https://...",
    "Snapshot=t50.inf",
    "Mode=HTML",
    ITEMDATA,
    "Name=Lang", "Value=en", ENDITEM,
    "Name=sessionId", "Value={WCSParam_Text1}", ENDITEM,
    LAST);

Paper icon.png Reference: http://motevich.blogspot.com/2008/11/manual-correlation-in-loadrunner.html


Parameter and parameterization

  1. In the recorded HTTP/HTML script, look for the hard coded value to be replaced with parameters. e.g. Password.
  2. Highlight the value and right click.
  3. Select Replace with a Parameter from the pop-up menu.
    Lr replace parameter.png
  4. Enter the name of the parameter, and select File for Parameter type.
    Lr new parameter.png
  5. Click on the Properties button.
  6. Enter the data file name under File path.
  7. Add a new row for each entry.
    Lr parameter properties.png

Afterwards, the hard-coded value in the script will be replace with {NewParam}

web_submit_form("SignOn",
    "Snapshot=t42.inf",
    ITEMDATA,
    "Name=FBC_Password", "Value={NewParam}, ENDITEM,
    LAST);

Paper icon.png Reference: http://motevich.blogspot.com/2007/11/loadrunner-parameter-parameterization.html


Outputing parameters

Example:

lr_output_message("Password is: %s", lr_eval_string("{Password}"));

Show browser during replay

In Virtual User Generator

  1. Go to Tools » General Options
  2. Click on Display tab
  3. Check Show browser during replay check box

Lr show browser.png

Enable Extended log

In Virtual User Generator

  1. Go to Vuser » Run-time Settings
  2. Go to General » Log
  3. Check Extended log

Lr extended logging.png

References

Retrieved from "/wiki/LoadRunner"
Personal tools
MY WEBSITES