|
场景1:
并发5个用户(该用户用的是一个用户名和密码),用于实现订票操作,跑5分钟,可以完成订票操作
场景2:
并发5个用户,这5个用户参数化(5个不同的用户名和密码),用于实现订票操作,现在就出现问题了
--------问题------------
1.所有的订票都在用户1里,其余的用户里没有进行订票操作
-----------------------
现在我该如何处理,能够实现每个用户都可以进行订票操作?
附代码:
Init:
/* -------------------------------------------------------------------------------
Script Title :
Script Description :
Recorder Version : 1196
------------------------------------------------------------------------------- */
vuser_init()
{
// [WCSPARAM WCSParam_Diff1 44 98866.3621709194fAiftDipfAtVzzzHDAfVcpzDVAcf] 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",
"IgnoreRedirections=Yes",
LAST);
web_url("mercuryWebTours",
"URL=http://127.0.0.1:1080/mercuryWebTours/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_submit_data("login.pl",
"Action=http://127.0.0.1:1080/mercuryWebTours/login.pl",
"Method=POST",
"TargetFrame=body",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={WCSParam_Diff1}", ENDITEM,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value={password}", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=login.x", "Value=29", ENDITEM,
"Name=login.y", "Value=4", ENDITEM,
LAST);
return 0;
}
Action:
Action()
{
lr_start_transaction("新增");
web_url("welcome.pl",
"URL=http://127.0.0.1:1080/mercuryWebTours/welcome.pl?page=search",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/nav.pl?page=menu&in=home",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
web_url("FormDateUpdate.class",
"URL=http://127.0.0.1:1080/mercuryWebTours/FormDateUpdate.class",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
web_url("CalSelect.class",
"URL=http://127.0.0.1:1080/mercuryWebTours/CalSelect.class",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
web_url("Calendar.class",
"URL=http://127.0.0.1:1080/mercuryWebTours/Calendar.class",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
web_submit_data("reservations.pl",
"Action=http://127.0.0.1:1080/mercuryWebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/reservations.pl?page=welcome",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=depart", "Value=Denver", ENDITEM,
"Name=departDate", "Value=09/05/2008", ENDITEM,
"Name=arrive", "Value=Frankfurt", ENDITEM,
"Name=returnDate", "Value=09/06/2008", ENDITEM,
"Name=numPassengers", "Value=2", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=.cgifields", "Value=roundtrip", ENDITEM,
"Name=.cgifields", "Value=seatType", ENDITEM,
"Name=.cgifields", "Value=seatPref", ENDITEM,
"Name=findFlights.x", "Value=42", ENDITEM,
"Name=findFlights.y", "Value=8", ENDITEM,
LAST);
web_submit_data("reservations.pl_2",
"Action=http://127.0.0.1:1080/mercuryWebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/reservations.pl",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=outboundFlight", "Value=010;386;09/05/2008", ENDITEM,
"Name=numPassengers", "Value=2", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=reserveFlights.x", "Value=39", ENDITEM,
"Name=reserveFlights.y", "Value=11", ENDITEM,
LAST);
web_submit_data("reservations.pl_3",
"Action=http://127.0.0.1:1080/mercuryWebTours/reservations.pl",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/reservations.pl",
"Snapshot=t6.inf",
"Mode=HTML",
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=pass2", "Value=", ENDITEM,
"Name=creditCard", "Value=", ENDITEM,
"Name=expDate", "Value=", ENDITEM,
"Name=oldCCOption", "Value=", ENDITEM,
"Name=numPassengers", "Value=2", ENDITEM,
"Name=seatType", "Value=Coach", ENDITEM,
"Name=seatPref", "Value=None", ENDITEM,
"Name=outboundFlight", "Value=010;386;09/05/2008", ENDITEM,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=returnFlight", "Value=", ENDITEM,
"Name=JSFormSubmit", "Value=off", ENDITEM,
"Name=.cgifields", "Value=saveCC", ENDITEM,
"Name=buyFlights.x", "Value=63", ENDITEM,
"Name=buyFlights.y", "Value=12", ENDITEM,
LAST);
lr_end_transaction("新增", LR_AUTO);
return 0;
}
End:
vuser_end()
{
web_url("welcome.pl_2",
"URL=http://127.0.0.1:1080/mercuryWebTours/welcome.pl?signOff=1",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://127.0.0.1:1080/mercuryWebTours/nav.pl?page=menu&in=flights",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);
return 0;
} |
|