zhuangyuhe 发表于 2015-6-4 21:13:23

loadrunner的web_reg_save_param能否关联web_custom_request的动态请求值

本人新人一枚,刚学loadrunner没多久,有几个小白问题,请各位大虾指教下:$
在测试的时候录制一段脚本,脚本背景是,在查询界面输入查询条件,查询后,点击查询结果中的代码连接,进入处理界面。录制的之后系统默认的提交函数是web_custom_request。但是这个函数的请求URL中包含了系统动态生成的值,每次点击都不一样的。但是我用web_reg_save_param函数获取不到这个动态生成的值。
录制的原脚本代码如下:
web_custom_request("jqueryAjax",
"URL=http://10.13.1.41:9081/undwrt/jqueryAjax?type=undwrt&PolicyNo=971021514401010000227&flag=1433231908610",
"Method=GET",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.13.1.41:9081/undwrt/bpm/forwardNode.do?nodeName=UnderwritingNoCar",
"Snapshot=t120.inf",
"Mode=HTTP",
"EncType=application/x-www-form-urlencoded",
LAST);

web_url("openLoading.html",
"URL=http://10.13.1.41:9081/undwrt/common/loading/openLoading.html",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t121.inf",
"Mode=HTTP",
LAST);

web_url("forwardURL.do",
"URL=http://10.13.1.41:9081/undwrt/standardURL/forwardURL.do?businessNo=971021514401010000227&nodeName=Underwriting&taskId=141239727&isCarRisk=false",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t122.inf",
"Mode=HTTP",
LAST);

其中web_custom_request函数中的URL参数中的值“&flag=1433231908610”。web_url函数中的forwardURL.do的URL参数中的“&taskId=141239727”是系统自动生成的值

关联后的脚本代码如下:
web_reg_save_param("PolicyNoflag",
"LB=http://10.13.1.41:9081/undwrt/jqueryAjax?type=undwrt&PolicyNo=",
"RB=",
"Ord=1",
"Search=ALL",
LAST);


web_custom_request("jqueryAjax",
"URL=http://10.13.1.41:9081/undwrt/jqueryAjax?type=undwrt&PolicyNo={businessNo}&flag={PolicyNoflag}",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=http://10.13.1.41:9081/undwrt/bpm/forwardNode.do?nodeName=UnderwritingNoCar",
"Snapshot=t119.inf",
"Mode=HTTP",
"EncType=application/x-www-form-urlencoded",
LAST);

web_url("openLoading.html",
"URL=http://10.13.1.41:9081/undwrt/common/loading/openLoading.html",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t120.inf",
"Mode=HTTP",
LAST);

web_reg_save_param("PolicyNotaskId",
"LB=taskId=",
"RB=&isCarRisk=false",
"Ord=1",
"Search=Body",
LAST);



web_url("forwardURL.do",
"URL=http://10.13.1.41:9081/undwrt/standardURL/forwardURL.do?businessNo={businessNo}&nodeName=Underwriting&taskId={PolicyNotaskId}&isCarRisk=false",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t121.inf",
"Mode=HTTP",
LAST);

其中把PolicyNo=971021514401010000227中的971021514401010000227参数化成{businessNo}。
而{PolicyNoflag}、{PolicyNotaskId}都是用web_reg_save_param关联。但是这两个关联函数都获取不到值的。执行脚本的时候都提示找不到值。

还有就是我之前查到,有人说web_reg_save_param函数放在web_submit_data前的获取不到值的。那放在web_custom_request也会一样获取不到值的么?
第二个web_reg_save_param是放在web_url前,为何也获取不到值?

cscscsc 发表于 2015-11-8 20:53:46

楼主在吗,我想请问,custom函数下的怎么找到自己需要关联的地方
页: [1]
查看完整版本: loadrunner的web_reg_save_param能否关联web_custom_request的动态请求值