Showing posts with label LR replay. Show all posts
Showing posts with label LR replay. Show all posts

Saturday, 13 September 2014

How to Insert Caching Functions in Web (Http/Html) Protocol in Load runner

This task describes how to use caching functions. Caching functions allow
you to save stored data into your browser’s cache, and load it at a later point
in the script.

To use the caching functions:

1 Insert the web_dump_cache function into your script.

2 Run the script at least once.

3 Insert the web_load_cache function into your script before the Vuser
actions.

4 Comment out the web_dump_cache function.

5 Run and save the script.


Example:
The following example illustrates a PeopleSoft Enterprise Vuser viewing the
details of his paycheck

Action()
{
// web_add_cookie("storedCookieCheck=true; domain=pbntas05; path=/");
web_load_cache("ActionLoad","FileName=c:\\temp\\{VuserName}paycheck",LAST);
web_browser("signon.html",
DESCRIPTION,
ACTION,
"Navigate=http://pbntas05:8200/ps/signon.html",
LAST);
lr_think_time(35);
web_edit_field("userid",
"Snapshot=t1.inf",
DESCRIPTION,
"Type=text",
"Name=userid",
ACTION,
"SetValue={VuserName}",
LAST);
web_edit_field("pwd",
"Snapshot=t2.inf",
DESCRIPTION,
"Type=password",
"Name=pwd",
ACTION,
"SetValue=HCRUSA_KU0007",
LAST);
lr_start_transaction("login");
web_button("Sign In",
"Snapshot=t3.inf",
DESCRIPTION,
"Type=submit",
"Tag=INPUT",
"Value=Sign In",
LAST);
lr_end_transaction("login", LR_AUTO);
web_image_link("CO_EMPLOYEE_SELF_SERVICE",
"Snapshot=t4.inf",
DESCRIPTION,
"Alt=",
"Name=CO_EMPLOYEE_SELF_SERVICE",
"Ordinal=1",
ACTION,
"ClickCoordinate=10,10",
LAST); …
web_text_link("Sign out",
"Snapshot=t7.inf",
DESCRIPTION,
"Text=Sign out",
"FrameName=UniversalHeader",
ACTION,
"UserAction=Click",
LAST);
/*web_dump_cache("paycheck","FileName=c:\\{VuserName}paycheck",
"Replace=yes", LAST);*/
return 0;
}

Wednesday, 10 September 2014

What is this "Wasted Time" in LR script replay?

Question
When I reply the script in VuGen, the following message is displayed in Output window -

Script_Name(LineNumber): Notify: Transaction "Transaction Name" ended with "Pass" status (Duration: 134.8640 Wasted Time: 2.0757).

What is this "Wasted Time"?
What is the significance of "Wasted Time"?

Answer
 From the product help:
Time spent on activities whose purpose is to support test analysis, but would never be performed by a browser user.

So what does it actually mean?
Here are a few examples:
Siebel-Web protocol – first web_reg_save_param… step that uses Siebel correlation library takes time on DLL  invocation and this time reported as “wasted”.
The similar case exists with openSSL components (additional 1 second before handshake).
Time spent of text search (web_reg_find) also reported as “wasted”.
So basically it is the time that was wasted in LR code which would not be wasted by a real user.