51Testing软件测试论坛

标题: 手动关联时的错误 [打印本页]

作者: 06fbling    时间: 2012-3-7 11:36
标题: 手动关联时的错误
本帖最后由 06fbling 于 2012-3-7 11:43 编辑

环境是Loadrunner 11
运行的是loadrunner 自带的例子 web tours,按书上的实验了一下通不过,请各位大侠指点指点
要关联的函数
[attach]77877[/attach]

第一种关联的写法

[attach]77874[/attach]

Action.c(23): Error -27212: "Name" and/or "Value" missing before the "ENDITEM" argument (number 10)   [MsgId: MERR-27212]
Action.c(23): Warning -26379: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) are deleted and will be handled as "not found"   [MsgId: MWAR-26379]
Action.c(23): Error -26377: No match found for the requested parameter "session". 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   [MsgId: MERR-26377]
Action.c(23): Error -26374: The above "not found" error(s) may be explained by header and body byte counts being 0 and 0, respectively.   [MsgId: MERR-26374]
Action.c(23): web_submit_data("login.pl") highest severity level was "ERROR", 0 body bytes, 0 header bytes   [MsgId: MMSG-26388]



第二种关联写法
[attach]77878[/attach]
回放时:
Action.c(23): Error -26377: No match found for the requested parameter "session". 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   [MsgId: MERR-26377]
Action.c(23): web_submit_data("login.pl") highest severity level was "ERROR", 795 body bytes, 225 header bytes   [MsgId: MMSG-26388]

作者: 06fbling    时间: 2012-3-7 11:40
本帖最后由 06fbling 于 2012-3-7 11:45 编辑


作者: 月华    时间: 2012-3-7 11:42
LZ直接复制粘贴的代码把,Session这个参数没有被lr识别成参数
作者: 06fbling    时间: 2012-3-7 12:01
要关联的代码是
"Name=userSession", "Value=107818.350749291fftfQAzptVzzzzzHDDcHfptDif", ENDITEM,

第一次写的关联代码是
web_reg_save_param("session",
  "LB=userSession Value=",
  "RB=>",
  "Ord=1",
  "Search=Body",         
  LAST);

"Name={session}", ENDITEM,

回放错误:
Action.c(23): Error -27212: "Name" and/or "Value" missing before the "ENDITEM" argument (number 10)   [MsgId: MERR-27212]
Action.c(23): Warning -26379: Pending web_reg_save_param/reg_find/create_html_param[_ex] request(s) are deleted and will be handled as "not found"   [MsgId: MWAR-26379]
Action.c(23): Error -26377: No match found for the requested parameter "session". 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   [MsgId: MERR-26377]
Action.c(23): Error -26374: The above "not found" error(s) may be explained by header and body byte counts being 0 and 0, respectively.   [MsgId: MERR-26374]
Action.c(23): web_submit_data("login.pl") highest severity level was "ERROR", 0 body bytes, 0 header bytes   [MsgId: MMSG-26388]


第二次写的代码为
web_reg_save_param("session",
  "LB=Name=userSession\",\"Value=",
  "RB=>",
        "Ord=1",
  "Search=Body",         
  LAST);

"Name=userSession","Value={session}"

回放错误:
Action.c(16): Registering web_reg_save_param was successful   [MsgId: MMSG-26390]
Action.c(23): Error -26377: No match found for the requested parameter "session". 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   [MsgId: MERR-26377]
Action.c(23): web_submit_data("login.pl") highest severity level was "ERROR", 795 body bytes, 225 header bytes   [MsgId: MMSG-26388]



正确的写法应该是怎么样的?
还有那个右边界值RB=> 中的  > 是什么意思呢?在脚本上不应该是 "



作者: 云层    时间: 2012-3-7 12:15
关联请写在刷新首页的请求前!!!!
作者: 06fbling    时间: 2012-3-7 17:14
我的
web_reg_save_param 是写在 web_submit_data 前的(web_submit_data 中有要关联的项)

我觉得是语法方面的问题,请那个大侠指教了,
作者: 云层    时间: 2012-3-7 17:26
再说一遍请把关联写在首页刷新前!!!!!
作者: flying1943    时间: 2012-3-7 19:23
回复 6# 06fbling
你的web_reg_save_param()函数要写在产生session的语句前,而不是提交数据的语句前
也就是说web_reg_save_param()函数是保存它下方的服务器返回的值为某个参数的
建议lz了解一下reg函数的特点
区分一下web_find和web_reg_find就明白了
作者: lilycheng1986    时间: 2012-3-21 10:34
右边界有误
应该是"RB=\""
作者: cindyker    时间: 2012-3-21 17:36

作者: tansunyj    时间: 2012-3-21 22:16
左边界双引号需要转义!~~(userSession", "Value=)-------->(userSession\", \"Value=)
作者: mimmy    时间: 2012-3-21 23:07
第一种关联方法错误,从源代码上看,左、右边界是要关联值的左边和右边,不能随意删掉双引号
作者: lxh_xwj    时间: 2012-10-24 10:26
回复 1# 06fbling


    ,很明显第一个写法完全错误,你得把服务器返回的数据贴出来啊,这谁知道你的左右边界对不对。




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2