|
我做了一个最简单的录制,就是登录后订票,然后退出
录制脚本如下:
#include "web_api.h"
Action()
{
web_submit_data("login.pl",
"Action=http://localhost:1080/MercuryWebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/MercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=96711.5033616849tQHtfQHpQftVzzzHcQitHpfiHHcf", ENDITEM,
"Name=username", "Value=lijiang", ENDITEM,
"Name=password", "Value=lijiang", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=56", ENDITEM,
"Name=login.y", "Value=5", ENDITEM,
LAST);
lr_think_time(9);
web_image("Search Flights Button",
"Alt=Search Flights Button",
"Snapshot=t3.inf",
LAST);
lr_think_time(7);
web_submit_form("reservations.pl",
"Snapshot=t4.inf",
ITEMDATA,
"Name=depart", "Value=London", ENDITEM,
"Name=departDate", "Value=11/02/2007", ENDITEM,
"Name=arrive", "Value=Los Angeles", ENDITEM,
"Name=returnDate", "Value=11/03/2007", ENDITEM,
"Name=numPassengers", "Value=2", ENDITEM,
"Name=roundtrip", "Value=<OFF>", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=findFlights.x", "Value=62", ENDITEM,
"Name=findFlights.y", "Value=10", ENDITEM,
LAST);
web_submit_form("reservations.pl_2",
"Snapshot=t5.inf",
ITEMDATA,
"Name=outboundFlight", "Value=230;773;11/02/2007", ENDITEM,
"Name=reserveFlights.x", "Value=65", ENDITEM,
"Name=reserveFlights.y", "Value=15", ENDITEM,
LAST);
lr_think_time(6);
web_submit_form("reservations.pl_3",
"Snapshot=t6.inf",
ITEMDATA,
"Name=firstName", "Value=ddasfsa", ENDITEM,
"Name=lastName", "Value=sadf", ENDITEM,
"Name=address1", "Value=sadf", ENDITEM,
"Name=address2", "Value=asdf", ENDITEM,
"Name=pass1", "Value= dsfa", ENDITEM,
"Name=pass2", "Value=sdf", ENDITEM,
"Name=creditCard", "Value=235326523643", ENDITEM,
"Name=expDate", "Value=", ENDITEM,
"Name=saveCC", "Value=<OFF>", ENDITEM,
"Name=buyFlights.x", "Value=83", ENDITEM,
"Name=buyFlights.y", "Value=10", ENDITEM,
LAST);
lr_think_time(1);
web_image("Itinerary Button",
"Alt=Itinerary Button",
"Ordinal=1",
"Snapshot=t7.inf",
LAST);
lr_think_time(2);
web_image("SignOff Button",
"Alt=SignOff Button",
"Ordinal=1",
"Snapshot=t8.inf",
LAST);
return 0;
}
回放时,报如下错误:
Action.c(22): Error -27987: Requested image not found [MsgId: MERR-27987]
Action.c(22): web_image("Search Flights Button") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
Action.c(29): Error -27979: Requested form not found [MsgId: MERR-27979]
Action.c(29): web_submit_form("reservations.pl") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
为什么不能回放呢,谢谢各位高手 |
|