loadrunner11 示例程序tourial的关联问题
请教大家一下,loadrunner11 示例程序tourial里,先单击 HP Web Tours 主页上的 administration (管理)链接。将打开administration (管理)页面。然后选择具有以下标题的复选框:Set LOGIN form's action tag to an error page.(将 LOGIN 表单的操作标记设置为错误页面。)向下滚动到页面底部并单击Update (更新)。录制一个订票脚本,回放脚本时出错,扫描脚本以查找需要关联时,在关联结果时,没看到任何需要关联的不一定是需要关联啊 这个脚本要在你打过勾之后重新录制的才行 回复 2# msnshow
但是他提示错误啊 我也遇到了同样的问题,不知道什么原因 遇到同样的问题,而且手动关联后也不能成功,脚本如下:
Action()
{
web_reg_save_param("login1","LB=name=userSession Value=","RB=>",LAST);
web_url("WebTours",
"URL=http://localhost:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
lr_think_time(9);
web_submit_data("login.pl",
"Action=http://localhost:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/nav.pl?in=home",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value={login1}", ENDITEM,
"Name=username", "Value=zq", ENDITEM,
"Name=password", "Value=zq", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=56", ENDITEM,
"Name=login.y", "Value=7", ENDITEM,
LAST);
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t3.inf",
LAST);
return 0;
}
返回结果:
Action.c(5): Error -26377: No match found for the requested parameter "login1". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size
Action.c(5): web_url("WebTours") highest severity level was "ERROR", 6876 body bytes, 1808 header bytes
求高手解答下,谢谢 回复 6# ansj
改成这样:
web_reg_save_param("login1",
"LB=value=",
"RB=>\n",
LAST); 回复 7# ldf326
改成楼上的,报错信息:
Error: The table 'E:\LR\login1\NewParam.dat' does not exist.
Warning: Extension parameng.dll reports error -13889 on call to function ExtPerProcessInitialize
Error: Thread Context: Call to service of the driver failed, reason - thread context wasn't initialized on this thread. 本帖最后由 ldf326 于 2012-5-18 15:11 编辑
回复 8# ansj
是你的参数化有问题,Error: The table 'E:\LR\login1\NewParam.dat' does not exist.
不要做成文件类型的,选择为vuser id 用html模式录制脚本就好了,不能用URL模式录制,但是我也不知道后面的道理。。。 说错了,不是这个,抱歉 没提示错误,是因为没跑到登录后的页面时,系统会重定向到登陆页面,此时LR也不会判断脚本出错,但如果你添加完文本检查点后,会看到,明显出错。顺便推广一下我的测试交流群:229403339,哈哈,希望加入 我的改成这样,还是fail
Action()
{
web_reg_save_param("login1",
"LB=value=",
"RB=>\n",
LAST);
请帮忙解决。 代码如下:
Action()
{
web_reg_save_param("login1",
"LB=value=",
"RB=>\n",
LAST);
web_url("WebTours",
"URL=http://localhost:1080/WebTours/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t9.inf",
"Mode=HTML",
LAST);
lr_think_time(7);
web_submit_data("login.pl",
"Action=http://localhost:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/nav.pl?in=home",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=108552.169623329ffiDzfcpccfDDfAVpQVDDf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
LAST);
web_submit_data("login.pl_2",
"Action=http://localhost:1080/WebTours/login.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/nav.pl?in=home",
"Snapshot=t10.inf",
"Mode=HTML",
ITEMDATA,
"Name=userSession", "Value=108552.169623329ffiDzfcpccfDDfAVpQVDDf", ENDITEM,
"Name=username", "Value=jojo", ENDITEM,
"Name=password", "Value=bean", ENDITEM,
"Name=JSFormSubmit", "Value=on", ENDITEM,
"Name=login.x", "Value=0", ENDITEM,
"Name=login.y", "Value=0", ENDITEM,
LAST);
web_image("Search Flights Button",
"Alt=Search Flights Button",
"Snapshot=t11.inf",
LAST);
lr_think_time(19);
web_url("FormDateUpdate.class",
"URL=http://localhost:1080/WebTours/FormDateUpdate.class",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
web_url("CalSelect.class",
"URL=http://localhost:1080/WebTours/CalSelect.class",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
web_url("Calendar.class",
"URL=http://localhost:1080/WebTours/Calendar.class",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
web_submit_data("reservations.pl",
"Action=http://localhost:1080/WebTours/reservations.pl",
"Method=POST",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/reservations.pl?page=welcome",
"Snapshot=t12.inf",
"Mode=HTML",
ITEMDATA,
"Name=advanceDiscount", "Value=0", ENDITEM,
"Name=depart", "Value=Denver", ENDITEM,
"Name=departDate", "Value=06/20/2012", ENDITEM,
"Name=arrive", "Value=Los Angeles", ENDITEM,
"Name=returnDate", "Value=06/21/2012", ENDITEM,
"Name=numPassengers", "Value=1", ENDITEM,
"Name=seatPref", "Value=Aisle", 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=40", ENDITEM,
"Name=findFlights.y", "Value=4", ENDITEM,
LAST);
web_submit_form("reservations.pl_2",
"Snapshot=t13.inf",
ITEMDATA,
"Name=outboundFlight", "Value=030;251;06/20/2012", ENDITEM,
"Name=reserveFlights.x", "Value=22", ENDITEM,
"Name=reserveFlights.y", "Value=10", ENDITEM,
LAST);
lr_think_time(59);
web_submit_form("reservations.pl_3",
"Snapshot=t14.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=06/10", ENDITEM,
"Name=saveCC", "Value=<OFF>", ENDITEM,
"Name=buyFlights.x", "Value=36", ENDITEM,
"Name=buyFlights.y", "Value=11", ENDITEM,
LAST);
lr_think_time(1927);
web_url("welcome.pl",
"URL=http://localhost:1080/WebTours/welcome.pl?page=itinerary",
"Resource=0",
"RecContentType=text/html",
"Referer=http://localhost:1080/WebTours/nav.pl?page=menu&in=flights",
"Snapshot=t15.inf",
"Mode=HTML",
LAST);
web_image("SignOff Button",
"Alt=SignOff Button",
"Snapshot=t16.inf",
LAST);
return 0; 回复 6# ansj
我在generation log 里面 发现有两个userSession
</HEAD><BODY BGCOLOR="#E0E7F1"><br clear>
<form method=post action=login.pl target=body>
<input type=hidden name=userSession value=8454108743.085621709ffQDtHcptzzzzzzHDDfzApiDti>
<form method=post action=error.pl onSubmit='doJSformSubmit1(this)' target=body>
<input type=hidden name=userSession value=1108743.085621709ffQDtHcptzzzzzzHDDfzApiDti> 这个问题怎么解决,我也遇到了这种问题,急死了。。。。。。 求教:这个问题解决了吗?我也遇到这个问题了,哎,愁死了。。。各种办法想尽了啊!!! 期待高人解决
其实我也遇到了相同的问题,我把我的代码发出来 大神帮看看吧 本质上的问题都是大家完全没有理解关联的实现原理,只在重复着工具的操作导致的问题
1.你需要明白为啥要做关联
2.你需要知道要关联的内容是什么结构
3.你需要知道怎么检查关联到了没有
否则只是看操作,实际是明白了表面,没有明白道理
页:
[1]
2