|
利用loadrunner自带的WebTours以Url-Based的方式录脚步然后作关联,日志提示关联成功了,但是最终的结果却不对
脚本如下
Action()
{
lr_think_time(13);
web_url("welcome.pl_2",
"URL=http://127.0.0.1:1080/WebTours/welcome.pl?page=search",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home",
"Snapshot=t29.inf",
"Mode=HTTP",
LAST);
web_concurrent_start(NULL);
web_url("nav.pl_3",
"URL=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?page=search",
"Snapshot=t30.inf",
"Mode=HTTP",
LAST);
web_reg_save_param("depart",
"LB=value=\"",
"RB=\">",
"Ord={cityid}",
LAST);
web_url("reservations.pl",
"URL=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/welcome.pl?page=search",
"Snapshot=t31.inf",
"Mode=HTTP",
LAST);
web_concurrent_end(NULL);
web_concurrent_start(NULL);
web_url("in_flights.gif",
"URL=http://127.0.0.1:1080/WebTours/images/in_flights.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
"Snapshot=t32.inf",
LAST);
web_url("home.gif",
"URL=http://127.0.0.1:1080/WebTours/images/home.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights",
"Snapshot=t33.inf",
LAST);
web_concurrent_end(NULL);
web_url("button_next.gif",
"URL=http://127.0.0.1:1080/WebTours/images/button_next.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome",
"Snapshot=t34.inf",
LAST);
lr_start_transaction("order");
lr_think_time(8);
web_reg_save_param("flightid",
"LB=value=",
"RB= checked",
LAST);
web_submit_data("reservations.pl_2",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome",
"Snapshot=t35.inf",
"Mode=HTTP",
ITEMDATA,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=depart", "Value={depart}", ENDITEM,
"Name=departDate", "Value=08/06/2018", ENDITEM,
"Name=arrive", "Value=London", ENDITEM,
"Name=returnDate", "Value=08/07/2018", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatPref", "Value=Window", ENDITEM,
"Name=seatType", "Value=Business", ENDITEM,
"Name=.cgifields", "Value=roundtrip", ENDITEM,
"Name=.cgifields", "Value=seatType", ENDITEM,
"Name=.cgifields", "Value=seatPref", ENDITEM,
"Name=findFlights.x", "Value=45", ENDITEM,
"Name=findFlights.y", "Value=7", ENDITEM,
LAST);
web_submit_data("reservations.pl_3",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
"Snapshot=t36.inf",
"Mode=HTTP",
ITEMDATA,
"Name=outboundFlight", "Value={flightid}", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=seatType", "Value=Business", ENDITEM,
"Name=seatPref", "Value=Window", ENDITEM,
"Name=reserveFlights.x", "Value=56", ENDITEM,
"Name=reserveFlights.y", "Value=11", ENDITEM,
LAST);
lr_think_time(11);
web_submit_data("reservations.pl_4",
"Action=http://127.0.0.1:1080/WebTours/reservations.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
"Snapshot=t37.inf",
"Mode=HTTP",
ITEMDATA,
"Name=firstName", "Value=newtest", ENDITEM,
"Name=lastName", "Value=0001", ENDITEM,
"Name=address1", "Value=shanghai", ENDITEM,
"Name=address2", "Value=china", ENDITEM,
"Name=pass1", "Value=newtest 0001", ENDITEM,
"Name=creditCard", "Value=12345678", ENDITEM,
"Name=expDate", "Value=19/08", ENDITEM,
"Name=oldCCOption", "Value=", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatType", "Value=Business", ENDITEM,
"Name=seatPref", "Value=Window", ENDITEM,
"Name=outboundFlight", "Value=020;491;08/06/2018", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=returnFlight", "Value=", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=.cgifields", "Value=saveCC", ENDITEM,
"Name=buyFlights.x", "Value=19", ENDITEM,
"Name=buyFlights.y", "Value=8", ENDITEM,
LAST);
web_url("bookanother.gif",
"URL=http://127.0.0.1:1080/WebTours/images/bookanother.gif",
"Resource=1",
"RecContentType=image/gif",
"Referer=http://127.0.0.1:1080/WebTours/reservations.pl",
"Snapshot=t38.inf",
LAST);
lr_end_transaction("order",LR_AUTO);
return 0;
}
|
|