|
5#
楼主 |
发表于 2006-4-25 15:40:18
|
只看该作者
action部分的脚本
#include "as_web.h"
Action()
{
web_url("index.html",
"URL=http://localhost/MercuryWebTours/index.html",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time( 7 );
//这里加上了关联函数
web_reg_save_param("MercurySession",
"LB=userSession=",
"RB=&username=mercury&password=mercury&JSFo",
"Ord=1",
"RelFrameId=1",
"Search=body",
LAST);
web_submit_data("login.pl",
"Action=http://localhost/MercuryWebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost/MercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={MercurySession}", ENDITEM,
"Name=username", "Value=meggie", ENDITEM,
"Name=password", "Value=mercury", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=67", ENDITEM,
"Name=login.y", "Value=13", ENDITEM,
LAST);
lr_think_time( 1 );
web_image("Search Flights Button",
"Alt=Search Flights Button",
"Snapshot=t3.inf",
EXTRARES,
"Url=FormDateUpdate.class", "Referer=", ENDITEM,
"Url=CalSelect.class", "Referer=", ENDITEM,
"Url=Calendar.class", "Referer=", ENDITEM,
"Url=YearMonthPanel.class", "Referer=", ENDITEM,
"Url=DayPanel.class", "Referer=", ENDITEM,
"Url=DateInfo.class", "Referer=", ENDITEM,
LAST);
lr_think_time( 4 );
web_submit_form("reservations.pl",
"Snapshot=t4.inf",
ITEMDATA,
"Name=depart", "Value=Frankfurt", ENDITEM,
"Name=departDate", "Value=05/11/2006", ENDITEM,
"Name=arrive", "Value=London", ENDITEM,
"Name=returnDate", "Value=05/13/2006", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=roundtrip", "Value=<OFF>", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=findFlights.x", "Value=27", ENDITEM,
"Name=findFlights.y", "Value=21", ENDITEM,
LAST);
web_submit_form("reservations.pl_2",
"Snapshot=t5.inf",
ITEMDATA,
"Name=outboundFlight", "Value=120;266;05/11/2006", ENDITEM,
"Name=reserveFlights.x", "Value=91", ENDITEM,
"Name=reserveFlights.y", "Value=21", ENDITEM,
LAST);
web_submit_form("reservations.pl_3",
"Snapshot=t6.inf",
ITEMDATA,
"Name=firstName", "Value=meggie", ENDITEM,
"Name=lastName", "Value=wang", ENDITEM,
"Name=address1", "Value=shanghai", ENDITEM,
"Name=address2", "Value=shanghai", ENDITEM,
"Name=pass1", "Value=meggie wang", ENDITEM,
"Name=creditCard", "Value=", ENDITEM,
"Name=expDate", "Value=", ENDITEM,
"Name=saveCC", "Value=<OFF>", ENDITEM,
"Name=buyFlights.x", "Value=67", ENDITEM,
"Name=buyFlights.y", "Value=7", ENDITEM,
LAST);
lr_think_time( 4 );
web_image("Home Button",
"Alt=Home Button",
"Ordinal=1",
"Snapshot=t7.inf",
LAST);
web_image("Itinerary Button",
"Alt=Itinerary Button",
"Ordinal=1",
"Snapshot=t8.inf",
LAST);
lr_think_time( 10 );
web_image("Home Button_2",
"Alt=Home Button",
"Ordinal=1",
"Snapshot=t9.inf",
LAST);
return 0;
}
[ 本帖最后由 drabit 于 2006-4-25 15:50 编辑 ] |
|