Wednesday, July 3, 2013

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;
}

No comments: