|
Step:
1 Use the Web(Http/Html) Protocol.
2 Use the Web Example "http://localhost:1080/mercuryWebTours/"
3 Code is below:
#include "web_api.h"
Action()
{
web_url("mercuryWebTours",
"URL=http://localhost:1080/mercuryWebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time( 4 );
web_submit_form("login.pl",
"Snapshot=t2.inf",
ITEMDATA,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=login.x", "Value=49", ENDITEM,
"Name=login.y", "Value=11", ENDITEM,
LAST);
web_image("Search Flights Button",
"Alt=Search Flights Button",
"Snapshot=t3.inf",
LAST);
lr_think_time( 2 );
web_submit_form("reservations.pl",
"Snapshot=t4.inf",
ITEMDATA,
"Name=depart", "Value=London", ENDITEM,
"Name=departDate", "Value=06/29/2007", ENDITEM,
"Name=arrive", "Value={NewParam}", ENDITEM,
"Name=returnDate", "Value=06/30/2007", 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=53", ENDITEM,
"Name=findFlights.y", "Value=11", ENDITEM,
LAST);
(48) web_submit_form("reservations.pl_2",
"Snapshot=t5.inf",
ITEMDATA,
"Name=outboundFlight", "Value=200;338;06/29/2007", ENDITEM,
"Name=reserveFlights.x", "Value=55", ENDITEM,
"Name=reserveFlights.y", "Value=12", ENDITEM,
LAST);
return 0;
}
4 Have the new NewParam and run 2 interation .The first one iteration is successful and the 2th iteration is failed.
5 The error is below:
Action.c(48): Error -27979: Requested form not found [MsgId: MERR-27979]
Action.c(48): web_submit_form("reservations.pl_2") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
6 When we annotate the sentence as /*"Name=outboundFlight", "Value=200;338;06/29/2007", ENDITEM,*/.All of the iteration is successful.
[ 本帖最后由 huangning 于 2007-6-28 17:25 编辑 ] |
|