性能测试工具 LR关联的问题,回放脚本可以成功,但是场景中关联部分成功部分报错

王旭 · December 27, 2012 · Last by 郭振华 replied at December 27, 2012 · 1573 hits

情况描述如题,错误代码如下
Action.c(172): Error -26377: No match found for the requested parameter "WCSParam45". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 1024 bytes, use web_set_max_html_param_len to increase the parameter size
1、我使用的自动关联,单次回放可以成功,是不是可以排除关联函数的问题?;
2、其次肯定不是字节长度的问题,因为变量都是系统返回的32位MD5码,1024足够了
百度了半天原因应该是因为前置的操作没有成功导致没有取到关联的变量值,这个的概率比较大,那就接下来请大神看看我的操作问题
脚本如下(省略了extrares中的内容)

lr_start_transaction("优化");

/* Registering parameter(s) from source task id 65
// {WCSParam2} = "351288cd84422bf48229ae1cc0ccb275"
// */
web_reg_save_param("WCSParam2",
"LB/DIG=3&md5=",
"RB/DIG=&show=",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);

web_url("优化词条",
"URL=http://d3m2.zhongsou.com/Keyword/ylogs?kid=ID}&action=seo{",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://d3m2.zhongsou.com/Keyword/seo",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,

LAST);

web_custom_request("autodata",
"URL=http://d3m2.zhongsou.com/Searchsource/autodata",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://d3m2.zhongsou.com/Searchsource/index?kid=ID}&faction=seo{",
"Snapshot=t5.inf",
"Mode=HTML",
"EncType=application/x-www-form-urlencoded; charset=UTF-8",
"BodyBinary=kid={ID}&keyword={word}&columns=鏂伴椈鍔ㄦ"
"\x80\x81"
"&typeid=3&md5={WCSParam2}",
EXTRARES,

LAST);

/* Registering parameter(s) from source task id 135
// {WCSParam45} = "50dae4a7f66f8deb140004cc"
// */
web_reg_save_param("WCSParam45",
"LB/DIG=type=\"checkbox\" value=\"",
"RB/DIG=\" />",
"Ord=1",
"Search=Body",
"RelFrameId=1",
LAST);

/* Registering parameter(s) from source task id 135
// {WCSParam47} = "50dae4a7f66f8deb140004cb"
// */
web_reg_save_param("WCSParam47",
"LB/DIG=type=\"checkbox\" value=\"",
"RB/DIG=\" />",
"Ord=2",
"Search=Body",
"RelFrameId=1",
LAST);

web_url("index",
"URL=http://d3m2.zhongsou.com/Searchsource/index?kid=ID}&faction=seo&keyword=word}&columns=%E6%96%B0%E9%97%BB%E5%8A%A8%E6%80%81{",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t6.inf",
"Mode=HTML",
EXTRARES,

LAST);

web_custom_request("temporary",
"URL=http://d3m2.zhongsou.com/Searchsource/temporary",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://d3m2.zhongsou.com/Searchsource/index?kid=ID}&faction=seo&keyword=word}&columns=%E6%96%B0%E9%97%BB%E5%8A%A8%E6%80%81{",
"Snapshot=t7.inf",
"Mode=HTML",
"EncType=application/x-www-form-urlencoded; charset=UTF-8",
"BodyBinary=typeid=3&id={WCSParam45},{WCSParam47}&kid={ID}&md5={WCSParam2}&temporary_keyword={word}&temporary_columns=鏂伴椈鍔ㄦ"
"\x80\x81"
"",
EXTRARES,

LAST);

web_url("index_2",
"URL=http://d3m2.zhongsou.com/Searchsource/index?kid=ID}&faction=seo&keyword=word}&columns=%E6%96%B0%E9%97%BB%E5%8A%A8%E6%80%81{",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t8.inf",
"Mode=HTML",
EXTRARES,

LAST);
lr_end_transaction("优化", LR_AUTO);

共收到 2 条回复 时间 点赞

在autodata刷新数据之后刷新出的数据每条都有一个对应的MD5,但是数据所处的位置在页面框内并不固定,是不是那个”ord=“的问题,如果是的话应该怎么修改?改成ord=all ?

1、首先确定你关联的值左右边界是固定的吗?如果不是看看是否可以使用正则来实现
2、ord这个参数的作用是:如果你关联的值,在一个页面中有多处存在,ord可以决定你来取第几个,默认ord为1,就是只取第一个,如果你想取第二个,可以设置ord=2,如果你都想取出来就可以设置ord=all 这样就把所有相匹配的值都取出来,作为一个数组来赋给你定义的变量

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up