|
web_url("mercuryWebTours",
"URL=http://localhost:1080/mercuryWebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time( 7 );
web_reg_save_param("TheFirstColleration","LB=Value=","RB=","Search=Body", LAST); //关联函数
lr_output_message ("TheFirstCollertaion=%s",lr_eval_string("{TheFirstColleration}")); //在这里我尝试着去取一下这个关联参数的值是空的,因此导致
在web_submit_data里面报错,但这个关联参数我在该脚本
的任何位置取到的都是空值,什么原因呀?
web_submit_data("login.pl",
"Action=http://localhost:1080/mercuryWebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://localhost:1080/mercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={TheFirstColleration}", ENDITEM, //被关联的参数,106082.538841636ftfzzcApfQVzzzzHDcHDQpHcDff
"Name=username", "Value=test002", ENDITEM,
"Name=password", "Value=test002", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=64", ENDITEM,
"Name=login.y", "Value=14", ENDITEM,
LAST);
web_url("Search Flights Button",
"URL=http://localhost:1080/mercuryWebTours/welcome.pl?page=search",
"TargetFrame=body",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost:1080/mercuryWebTours/nav.pl?page=menu&in=home",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
lr_think_time( 2 );
web_submit_data("reservations.pl",
"Action=http://localhost:1080/mercuryWebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://localhost:1080/mercuryWebTours/reservations.pl?page=welcome",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=depart", "Value=Denver", ENDITEM,
"Name=departDate", "Value=07/03/2011", ENDITEM,
"Name=arrive", "Value=Frankfurt", ENDITEM,
"Name=returnDate", "Value=07/04/2011", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=.cgifields", "Value=seatPref", ENDITEM,
"Name=.cgifields", "Value=seatType", ENDITEM,
"Name=.cgifields", "Value=roundtrip", ENDITEM,
"Name=findFlights.x", "Value=68", ENDITEM,
"Name=findFlights.y", "Value=14", ENDITEM,
LAST); |
|