Highlighted
Absent Member.
Absent Member.
755 views

Cookies in Loadrunner

I developed a basic script using mercury tours web application.
1.I signed in using "jojo","bean"
2. I saw a confirmation web page for "welocome jojo"
3.and signed off.

I have copied the script here.

I don't know how to record the script wihtout cookies.

Action()
{

web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t15.inf",
"Mode=HTML",
LAST);

web_url("WebTours_2",
"URL=http://127.0.0.1:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t16.inf",
"Mode=HTML",
LAST);

web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=104726.979748886fDiziQtpAcAiDDDDDcDcVpDztVcf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
LAST);

lr_think_time(8);

web_submit_data("login.pl_2",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t17.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=104726.979748886fDiziQtpAcAiDDDDDcDcVpDztVcf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=64", ENDITEM,
"Name=login.y", "Value=2", ENDITEM,
LAST);

web_submit_data("login.pl_3",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t18.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=104726.979748886fDiziQtpAcAiDDDDDcDcVpDztVcf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=64", ENDITEM,
"Name=login.y", "Value=2", ENDITEM,
LAST);

lr_think_time(4);

web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t19.inf",
LAST);

web_add_cookie("MSO=SID&1292854565&MSO_JSFormSubmit1&on&MSO_ServerErrorsProb&50&MSO_ServerLoadProb&50; DOMAIN=127.0.0.1");

web_add_cookie("MTUserInfo=hash&47&firstName&Joseph&expDate&%0A&creditCard&&address1&234%20Willow%20Drive&lastName&Marshall%0A&address2&San%20Jose%2FCA%2F94085&username&jojo; DOMAIN=127.0.0.1");

web_image("SignOff Button_2",
"Alt=SignOff Button",
"Snapshot=t20.inf",
LAST);

return 0;
}
0 Likes
2 Replies
Highlighted
Established Member..
Established Member..

Re: Cookies in Loadrunner

simple....after recording comment out cookies that got generated during recording....

Thanks,
Prasenjit
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Cookies in Loadrunner

You can delete all the cookies in the entire script. It doesnt create any change/problem during your execution.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.