51Testing软件测试论坛
标题:
LR参数化用户后不能正确的实现增加操作
[打印本页]
作者:
guojinjin2006
时间:
2008-9-4 14:53
标题:
LR参数化用户后不能正确的实现增加操作
场景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;
}
作者:
hankliu520
时间:
2008-9-4 16:00
应该是你参数化时选择的分配数据方式不对吧
作者:
guojinjin2006
时间:
2008-9-4 18:03
存在的几种方式我都试过了,可是都不行,到底是因为什么原因呀,我参数化的用户名和密码在数据库中也是存在的呀!
急。。。
作者:
msnshow
时间:
2008-9-5 10:48
肯定是提交订票的那个操作中,有用户的ID之类的,你没有参数化到吧
作者:
mr.bee
时间:
2008-9-5 13:07
没看脚本
临时有事
应该是关联的问题
提交表单的部分需要关联
作者:
guojinjin2006
时间:
2008-9-5 13:11
我已经设置了关联,现在的问题是为什么脚本执行完毕后,把所有的订票都在一个用户里,其余的用户没有实现订票操作
作者:
zqsdy
时间:
2008-9-7 15:51
应该是参数化的问题,lz没有给每个用户指定一个资源吧
作者:
小七七
时间:
2008-9-7 19:24
我也觉得可能是参数化那块数据读取方式的问题,请问楼主是怎么设置的呀~
作者:
guojinjin2006
时间:
2008-9-8 11:11
我用的都是默认的设置,参数化后
select next row : Sequential
Update value on: Each iteration
作者:
guojinjin2006
时间:
2008-9-8 12:17
问题已解决,我开始的脚本是把登录操作放到Init里,现在把登录放到Action里就可以了。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2