[求助]LR脚本里面 怎么写访问完页面自动清除cookies
需求是这样的,不同访客登录同一公司(清除cookie就可当成新访客)所以想在 LoadRunner里面加段脚本 可以清除cookies
这样是不是对的.可行吗?
要怎么写
web_clear_cookie("SID=514638_28edabc9; DOMAIN=www.****.com");
这句对吗? 没人回答 再顶下 希望高手回答! 关注。。。 把脚本中的COOKIE删了不就行了吗 回复 5# flyven
哦 是哦 我试试 谢谢 每次录制时,录制脚本里面都有好多web_add_cookie(),怎样才能不录制这些cookie呢 回复 7# lyylovewsq
没录制到 ,因为我是用简单的网页调用 JavaScript然后链接,是调用js的
<script type="text/javascript" src="http://www.test?siteid=40313"></script>
是在所以没有,主要是调用 网页聊天的那种.比如客服聊天.
那这样我要怎么办?因为录制的时候没有cookies脚本.
web_url("style2.aspx",
"URL=http://www.test?siteid=40313?{NewParam}",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=http://ww2.test2.com:9999/js/QYT_Jquery.js?", "Referer=", ENDITEM,
LAST);
你觉得我这样要怎么模拟环境呢,清除cookies 就是一个新的访客 在int脚本里先清一下cookie,后面的cookie应该不用清除吧 LR的Run-Time settings里面有个选项可以设置,在每次运行完的时候清除cookie的 回复 8# caiw0418
我也在找这个,请问你后来是怎样解决的啊? cookie分两种,临时的lr能自动处理,不体现在脚本内,另外一种体现在脚本内
楼主可以在runtime setting的browser里面让vuser每次迭代都模拟新的访问 回复 1# caiw0418
我也是啊,录制完,脚本里也出现web_add_cookie("s_fid=0FB96953C14617FA-03D7529ADF6AC13E; DOMAIN=127.0.0.1");(我录制的是系统自带的订票系统)
这个该怎么处理,查了好多资料,都没解决掉
完整脚本如下:
Action()
{
web_add_cookie("s_fid=0FB96953C14617FA-03D7529ADF6AC13E; DOMAIN=127.0.0.1");
web_url("WebTours",
"URL=http://127.0.0.1:1080/WebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
//lr_think_time(6);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=111164.070068854fHViAAVpiftVzzzHDtDAipAVVVcf", ENDITEM,
"Name=username", "Value=she", ENDITEM,
"Name=password", "Value=000", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=51", ENDITEM,
"Name=login.y", "Value=4", ENDITEM,
LAST);
web_submit_data("login.pl_2",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=111164.070068854fHViAAVpiftVzzzHDtDAipAVVVcf", ENDITEM,
"Name=username", "Value=she", ENDITEM,
"Name=password", "Value=000", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
LAST);
//lr_think_time(4);
web_url("Search Flights Button",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_submit_data("reservations.pl",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=depart", "Value=Denver", ENDITEM,
"Name=departDate", "Value=06/28/2013", ENDITEM,
"Name=arrive", "Value=London", ENDITEM,
"Name=returnDate", "Value=06/29/2013", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=.cgifields", "Value=roundtrip", ENDITEM,
"Name=.cgifields", "Value=seatType", ENDITEM,
"Name=.cgifields", "Value=seatPref", ENDITEM,
"Name=findFlights.x", "Value=47", ENDITEM,
"Name=findFlights.y", "Value=8", ENDITEM,
LAST);
web_submit_data("reservations.pl_2",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=outboundFlight", "Value=020;338;06/28/2013", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=reserveFlights.x", "Value=54", ENDITEM,
"Name=reserveFlights.y", "Value=17", ENDITEM,
LAST);
web_submit_data("reservations.pl_3",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
"Snapshot=t7.inf",
"Mode=HTML",
ITEMDATA,
"Name=firstName", "Value=shi", ENDITEM,
"Name=lastName", "Value=tou", ENDITEM,
"Name=address1", "Value=shanghai", ENDITEM,
"Name=address2", "Value=100804", ENDITEM,
"Name=pass1", "Value=shi tou", ENDITEM,
"Name=creditCard", "Value=", ENDITEM,
"Name=expDate", "Value=", ENDITEM,
"Name=oldCCOption", "Value=", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=outboundFlight", "Value=020;338;06/28/2013", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=returnFlight", "Value=", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=.cgifields", "Value=saveCC", ENDITEM,
"Name=buyFlights.x", "Value=65", ENDITEM,
"Name=buyFlights.y", "Value=7", ENDITEM,
LAST);
web_submit_data("reservations.pl_4",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
"Snapshot=t8.inf",
"Mode=HTML",
ITEMDATA,
"Name=Book Another.x", "Value=45", ENDITEM,
"Name=Book Another.y", "Value=17", ENDITEM,
LAST);
web_url("SignOff Button",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?signOff=1",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
return 0;
}
求高手指点! 请问后来,你是怎么解决的? 回复 13# xiaoshi_2011
你是怎么解决的?
页:
[1]