LoadRunner
From wiki.vincentkong.com
Contents |
Recording a HTTP/HTML script
- Open Virtual User Generator
- Select Web (HTTP/HTML) protocol for web application recording
- Fill in the information in the dialog:
- Click OK to start recording
Record non HTML elements in separate steps
- In the Start Recording dialog box, click on the Options button.
- Under General » Recording, click on HTML Advanced button.
- Under Non HTML-generated elements..., check Record in separates steps and use concurrent groups checkbox.
Time transactions
In the recorded HTTP/HTML script:
- Select View Tree.
- Select the step to start timing the transaction and right click.
- Select Insert Before... from the pop-up menu.
- Select Start Transaction, and enter the transaction name.
- Repeat the step for End Transaction
Manual Correlation
- Find dynamic value in the server response. e.g
sessionId - Highlight the value and right click.
- Select Create Parameter from pop-up menu.
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);
Reference: http://motevich.blogspot.com/2008/11/manual-correlation-in-loadrunner.html
Parameter and parameterization
- In the recorded HTTP/HTML script, look for the hard coded value to be replaced with parameters. e.g. Password.
- Highlight the value and right click.
- Select Replace with a Parameter from the pop-up menu.
- Enter the name of the parameter, and select File for Parameter type.
- Click on the Properties button.
- Enter the data file name under File path.
- Add a new row for each entry.
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);
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
- Go to Tools » General Options
- Click on Display tab
- Check Show browser during replay check box
Enable Extended log
In Virtual User Generator
- Go to Vuser » Run-time Settings
- Go to General » Log
- Check Extended log