|
我回放的是LR8.0自带的脚本tutorial下的脚本
#include "web_api.h"
Action()
{
// [WCSPARAM WCSParam_Diff1 44 88160.6878088295tfDtHzfpDHQVzzzHcHcAipfQccHf] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param("WCSParam_Diff1",
"LB=userSession value=",
"RB=>",
"Ord=1",
"RelFrameId=1.2.1",
"Search=Body",
LAST);
web_url("MercuryWebTours",
"URL=http://localhost:1080/MercuryWebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time(2);
lr_start_transaction("logon");
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={WCSParam_Diff1}", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=43", ENDITEM,
"Name=login.y", "Value=9", ENDITEM,
LAST);
lr_end_transaction("logon", LR_AUTO);
lr_think_time(2);
lr_start_transaction("search_flight");
web_image("Search Flights Button",
"Alt=Search Flights Button",
"Snapshot=t3.inf",
EXTRARES,
"URL=FormDateUpdate.class", ENDITEM,
"URL=CalSelect.class", ENDITEM,
LAST);
lr_end_transaction("search_flight", LR_AUTO);
lr_think_time(2);
web_submit_form("reservations.pl",
"Snapshot=t4.inf",
ITEMDATA,
"Name=depart", "Value={origin}", ENDITEM,
"Name=departDate", "Value=06/28/2004", ENDITEM,
"Name=arrive", "Value=Los Angeles", ENDITEM,
"Name=returnDate", "Value=06/29/2004", 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=43", ENDITEM,
"Name=findFlights.y", "Value=14", ENDITEM,
LAST);
lr_think_time(2);
lr_start_transaction("book_flight");
lr_think_time(2);
web_submit_form("reservations.pl_2",
"Snapshot=t5.inf",
ITEMDATA,
"Name=reserveFlights.x", "Value=38", ENDITEM,
"Name=reserveFlights.y", "Value=4", ENDITEM,
LAST);
lr_end_transaction("book_flight", LR_AUTO);
lr_think_time(2);
web_reg_find("Text=Thank you",
LAST);
web_submit_form("reservations.pl_3",
"Snapshot=t6.inf",
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=12345678", ENDITEM,
"Name=expDate", "Value=", ENDITEM,
"Name=saveCC", "Value=<OFF>", ENDITEM,
"Name=buyFlights.x", "Value=60", ENDITEM,
"Name=buyFlights.y", "Value=13", ENDITEM,
LAST);
lr_think_time(2);
web_image_check("web_image_check",
"Src=splash_flightconfirm.gif",
LAST);
lr_start_transaction("check_itinerary");
web_image("Itinerary Button",
"Alt=Itinerary Button",
"Ordinal=1",
"Snapshot=t7.inf",
LAST);
lr_end_transaction("check_itinerary", LR_AUTO);
lr_think_time(2);
lr_start_transaction("logoff");
web_image("SignOff Button",
"Alt=SignOff Button",
"Ordinal=1",
"Snapshot=t8.inf",
LAST);
lr_output_message("The flight was booked into the Message Text box.");
lr_error_message("An error has occurred into the Message text box.");
lr_end_transaction("logoff", LR_AUTO);
return 0;
[ 本帖最后由 laipi 于 2008-4-23 17:44 编辑 ] |
|