【求助】我关联为啥老是报错呢 麻烦各位指点下
Action(){
web_reg_save_param("Sn_ID",
"LB=Set-Cookie: JSESSIONID=",
"RB=; Path=/CHP",
"Ord=1",
"IgnoreRedirections=Yes",
LAST);
web_url("CHP",
"URL=http://172.18.97.79:8080/CHP",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTTP",
LAST);
web_custom_request("dwrChangeEmergencyPhone.initEP.dwr",
"URL=http://172.18.97.79:8080/CHP/dwr/call/plaincall/dwrChangeEmergencyPhone.initEP.dwr",
"Method=POST",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://172.18.97.79:8080/CHP/index.do?action=init",
"Snapshot=t56.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\n"
"page=/CHP/index.do?action=init\n"
"httpSessionId={Sn_ID}\n"
"scriptSessionId=BA912538F322B43E844119F461FF0C1C879\n"
"c0-scriptName=dwrChangeEmergencyPhone\n"
"c0-methodName=initEP\n"
"c0-id=0\n"
"batchId=1\n",
LAST);
web_custom_request("dwrChangeKnowledgeBase.initKB.dwr",
"URL=http://172.18.97.79:8080/CHP/dwr/call/plaincall/dwrChangeKnowledgeBase.initKB.dwr",
"Method=POST",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://172.18.97.79:8080/CHP/index.do?action=init",
"Snapshot=t58.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\n"
"page=/CHP/index.do?action=init\n"
"httpSessionId={Sn_ID}\n"
"scriptSessionId=BA912538F322B43E844119F461FF0C1C879\n"
"c0-scriptName=dwrChangeKnowledgeBase\n"
"c0-methodName=initKB\n"
"c0-id=0\n"
"batchId=0\n",
LAST);
web_custom_request("dwrChangeHospital.initHp.dwr",
"URL=http://172.18.97.79:8080/CHP/dwr/call/plaincall/dwrChangeHospital.initHp.dwr",
"Method=POST",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://172.18.97.79:8080/CHP/index.do?action=init",
"Snapshot=t59.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\n"
"page=/CHP/index.do?action=init\n"
"httpSessionId={Sn_ID}\n"
"scriptSessionId=BA912538F322B43E844119F461FF0C1C879\n"
"c0-scriptName=dwrChangeHospital\n"
"c0-methodName=initHp\n"
"c0-id=0\n"
"batchId=2\n",
LAST);
return 0;
}
这是我的脚本 关联后的
Action()
{
web_url("CHP",
"URL=http://172.18.97.79:8080/CHP",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTTP",
LAST);
web_custom_request("dwrChangeEmergencyPhone.initEP.dwr",
"URL=http://172.18.97.79:8080/CHP/dwr/call/plaincall/dwrChangeEmergencyPhone.initEP.dwr",
"Method=POST",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://172.18.97.79:8080/CHP/index.do?action=init",
"Snapshot=t60.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\npage=/CHP/index.do?action=init\nhttpSessionId=F6E3D5E55BF50FEA79AAE2EE587984DF\nscriptSessionId=F144FADF67CDFB6DE6ECDFAF1F14DB50476\nc0-scriptName=dwrChangeEmergencyPhone\nc0-methodName=initEP\nc0-id=0\nbatchId=1\n",
LAST);
web_custom_request("dwrChangeKnowledgeBase.initKB.dwr",
"URL=http://172.18.97.79:8080/CHP/dwr/call/plaincall/dwrChangeKnowledgeBase.initKB.dwr",
"Method=POST",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://172.18.97.79:8080/CHP/index.do?action=init",
"Snapshot=t61.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\npage=/CHP/index.do?action=init\nhttpSessionId=F6E3D5E55BF50FEA79AAE2EE587984DF\nscriptSessionId=F144FADF67CDFB6DE6ECDFAF1F14DB50476\nc0-scriptName=dwrChangeKnowledgeBase\nc0-methodName=initKB\nc0-id=0\nbatchId=0\n",
LAST);
web_custom_request("dwrChangeHospital.initHp.dwr",
"URL=http://172.18.97.79:8080/CHP/dwr/call/plaincall/dwrChangeHospital.initHp.dwr",
"Method=POST",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://172.18.97.79:8080/CHP/index.do?action=init",
"Snapshot=t62.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\npage=/CHP/index.do?action=init\nhttpSessionId=F6E3D5E55BF50FEA79AAE2EE587984DF\nscriptSessionId=F144FADF67CDFB6DE6ECDFAF1F14DB50476\nc0-scriptName=dwrChangeHospital\nc0-methodName=initHp\nc0-id=0\nbatchId=2\n",
LAST);
return 0;
}
这是关联前的~
回放后
Virtual User Script started at : 2010-12-29 15:00:51
Starting action vuser_init.
Web Turbo Replay of LoadRunner 11.0.0 for WINXP; build 8859 (Aug 18 2010 20:14:31)
Run Mode: HTML
Run-Time Settings file: "E:\练习Loadrunder\GuanLian1\\default.cfg"
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(3): Registering web_reg_save_param was successful
Action.c(10): Redirecting "http://172.18.97.79:8080/CHP" (redirection depth is 0)
Action.c(10): To location "http://172.18.97.79:8080/CHP/"
Action.c(10): Redirecting "http://172.18.97.79:8080/CHP/" (redirection depth is 1)
Action.c(10): To location "http://172.18.97.79:8080/CHP/index.do?action=init"
Action.c(10): Error -26377: No match found for the requested parameter "Sn_ID". 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(10): web_url("CHP") highest severity level was "ERROR", 179504 body bytes, 821 header bytes, 186 chunking overhead bytes
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
就这样了 呜呜 本帖最后由 ericnola 于 2010-12-29 16:16 编辑
请问楼主用的LR哪个版本?
"RB=; Path=/CHP",
改成 "RB=; Path=\/CHP",Ord=1改成Ord=all;试下 设置好关联。在使用关联的后边打个断点,看看Sn_ID有没有值。 回复 2# ericnola
我用的是Loadrunder11浏览器是IE8浏览器
刚才用Loadrunder9.5+IE6录了一遍 只是打开网页 打的特别慢 特别特别的慢
会不会是程序问题呀 回复 2# ericnola
回放完 报错部分是
Action.c(10): Error -26377: No match found for the requested parameter "Sn_ID". 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(10): web_url("CHP") highest severity level was "ERROR", 179504 body bytes, 821 header bytes, 186 chunking overhead bytes
Ending action Action. 找不到关联有多种可能
1.取关联位置错:关联函数放错位置,可能是放在要取数据的操作函数后面,或取不到需要的关联数据的函数前面。在服务器响应中查找是否有需要的关联数据
2.关联函数后的操作函数执行失败或不符合要求,这可能是URL错,提交数据错,使用的参数错,等等。查看视图树中的页面视图和服务器响应
3.关联函数有错:参数命名错(取的与用的名称不一致),左/右边界错,取值序数错,搜索范围错,等等。查参数命名和服务器响应
4.取值数据过长。默认256字符,用web_set_max_html_param_len()增大
你的情况可能是前3种 马克一下
页:
[1]