订票系统中对往返地点进行关联,怎么操作?初值怎么设置?(新手上路)
Action(){
//Value=108909.007371405fzAcAAHpAzzzzzzHDDzVcpAtct
web_reg_save_param("SessionID",
"LB=userSession value=",
"RB=>",
"Ord=1",
LAST);
lr_start_transaction("open web");
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_end_transaction("open web",LR_AUTO);
lr_start_transaction("login");
lr_think_time(12);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/WebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={SessionID}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=63", ENDITEM,
"Name=login.y", "Value=13", ENDITEM,
LAST);
lr_end_transaction("login",LR_AUTO);
lr_start_transaction("flights");
lr_think_time(8);
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=t3.inf",
"Mode=HTML",
EXTRARES,
"Url=FormDateUpdate.class", "Referer=", ENDITEM,
"Url=CalSelect.class", "Referer=", ENDITEM,
LAST);
lr_think_time(6);
web_reg_save_param("depart",
"LB=Departure City :</td> <td><select name="depart" ><option selected="selected" value=",
"RB=>",
"Ord=1",
LAST);
web_reg_save_param("arrival",
"LB=Arrival City :</td> <td><select name="arrive" ><option selected="selected" value=",
"RB=>",
"Ord=1",
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=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=depart", "Value=London", ENDITEM,
//Departure City :</td> <td><select name="depart" ><option selected="selected" value="Denver">Denver</option>
"Name=depart", "Value={depart}", ENDITEM,
"Name=departDate", "Value=08/10/2012", ENDITEM,
"Name=arrive", "Value=Paris", ENDITEM,
//Arrival City :</td> <td><select name="arrive" ><option selected="selected" value="Denver">Denver</option>
"Name=arrive", "Value={arrival}", ENDITEM, "Name=returnDate", "Value=08/11/2012", 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=25", ENDITEM,
"Name=findFlights.y", "Value=10", 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=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=outboundFlight", "Value=240;108;08/10/2012", 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=41", ENDITEM,
"Name=reserveFlights.y", "Value=14", ENDITEM,
LAST);
lr_think_time(16);
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=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=firstName", "Value=Joseph", ENDITEM,
"Name=lastName", "Value=Marshall", ENDITEM,
"Name=address1", "Value=234 Willow Drive", ENDITEM,
"Name=address2", "Value=San Jose/CA/94085", ENDITEM,
"Name=pass1", "Value=Joseph Marshall", 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=240;108;08/10/2012", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=returnFlight", "Value=", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=.cgifields", "Value=saveCC", ENDITEM,
"Name=buyFlights.x", "Value=19", ENDITEM,
"Name=buyFlights.y", "Value=11", ENDITEM,
LAST);
lr_think_time(9);
web_url("Itinerary Button",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=itinerary",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
lr_end_transaction("flights",LR_AUTO);
lr_start_transaction("itinerary");
lr_think_time(22);
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=itinerary",
"Snapshot=t8.inf",
"Mode=HTML",
LAST);
lr_end_transaction("itinerary",LR_AUTO);
lr_start_transaction("signoff");
lr_end_transaction("signoff",LR_AUTO);
return 0;
} 代码肯定是错的,关联的位置不对,鉴定完毕 回复 2# 云层
高手,那么你能告诉我该怎么进行关联阿?谢谢 关联的边界有问题,你这样肯定执行不过去的。 回复 4# mystic
关联边界怎么设置啊!求教啊 你使用一下自动扫描关联 就会发现打开的是http视图,关联的左右边界跟脚本代码无关,在这个http视图上找吧 回复 6# 398073412
我现在是手动关联不是自动的,我想知道具体设置关联的位置还有哪里有错误,呵呵…… 通过自动关联,看得到的脚本呗,和手动一样的 回复 7# liuting0589
急功近利的人,别以为手动关联很了不起,没学会爬就想跑啊?你如果自动关联成功了,而手动关联时失败,前者这么一个活生生的对比样本摆在你面前了,你还不能找到失败的地方?这么简单的思维都没有的话实在很难研究下去的,你希望别人直接告诉你答案的话,那你肯定还会遇到类似的问题却还不会自行解决。
一种思维或方法可以解决很多问题,而一个答案只对应一个问题! 是代码中红色的地方报错吗?那个订票网站我倒是没怎么用过,web_reg_save_param函数为注册类型函数,先注册后使用的,它的位置应该放在服务器返回响应之前,如果打开一个页面会出现depart和arrive的话,web_reg_save_param函数应该放在这个页面请求之前的位置
页:
[1]