51Testing软件测试论坛

标题: 又一个关联失败问题! [打印本页]

作者: fessor21    时间: 2010-1-28 17:01
标题: 又一个关联失败问题!
背景:保存页面时server生成一个ID,做个关联。
试过好多次,运行无法通过。请参考附件:

== Define correction in script.
web_reg_save_param("caseID",
                "LB=RegisterCaseDetail.aspx?CaseID=",
                "RB=|",
                "Ord=All",
                "Search=Body",
                "RelFrameId=1",
                "IgnoreRedirections=Yes",
                LAST);


=====Replay log:
Action.c(320): Error -26377: No match found for the requested parameter "caseID". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 26008 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
Action.c(320): Notify: Saving Parameter "caseID_count = 0"
作者: aman_cao    时间: 2010-1-28 17:30
看下正则匹配就明白了。
作者: fessor21    时间: 2010-1-28 18:20
谢谢!
不过,我把左边界去除特殊符号也是同样错误,一个找不到? 右边界 “|” 需要转义?我也试过“/|”也不行。 能不能详细点呢?急啊。
== Define correction in script.
web_reg_save_param("caseID",
                "LB=CaseID=",   // RegisterCaseDetail.aspx?CaseID=
                "RB=|",   
                "Ord=All",
                "Search=Body",
                "RelFrameId=1",
                "IgnoreRedirections=Yes",
                LAST);
作者: fessor21    时间: 2010-1-28 19:37
== 改用URL录制,这样定义关联也找不到

web_reg_save_param("caseID",
                "LB=CaseID=",
                "RB=\nCache-Control: private",   // 这样也不对:"RB=\n Cache-Control: private",
                "Ord=All",
                "Search=All",
                "RelFrameId=1",
                "IgnoreRedirections=Yes",
                LAST);

== (取自generation Log)下面是第一次出现 “CaseID” 的地方

****** Response Header For Transaction With Id 310 ******
HTTP/1.1 302 Found
Date: Thu, 28 Jan 2010 09:06:01 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Location: /test/CaseModule/RegisterCaseDetail.aspx?CaseID=1042
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 195

==

Action.c(482): Error -26377: No match found for the requested parameter "caseID". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 26008 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
作者: 云层    时间: 2010-1-28 23:40
web_reg_save_param("caseID",
                "LB=RegisterCaseDetail.aspx?CaseID=",
                "RB=",
                "Ord=1",
                "Search=Body",
                 LAST);

试试,我觉得是那个竖线的问题
作者: fessor21    时间: 2010-1-29 07:18
谢谢云层大侠,我会试试你说的方式。
作者: aman_cao    时间: 2010-1-29 09:13
|竖线要转义,使用\| 试一下
作者: 菜也快乐着    时间: 2010-1-29 09:13
个人觉得脚本看起来没有问题,最可能就是竖线的问题,但云层直接去除右边界,这个好像不行吧,除非左边界唯一确定。

不过云层是俺滴偶像,说行,你就试试先。
作者: 菜也快乐着    时间: 2010-1-29 09:15
原帖由 fessor21 于 2010-1-28 18:20 发表
谢谢!
不过,我把左边界去除特殊符号也是同样错误,一个找不到? 右边界 “|” 需要转义?我也试过“/|”也不行。 能不能详细点呢?急啊。
== Define correction in script.
web_reg_save_param("caseID",
      ...



才看到 这句 “右边界 “|” 需要转义?我也试过“/|”也不行。 ” 转义 是反斜杠啦。。
作者: aman_cao    时间: 2010-1-29 09:27
/ 表示文本正则表达式的开始或结束,若要匹配 / 字符,使用 \/。
|
       

| 表示:左右两边表达式之间 "或" 关系。匹配 "|" 本身,请使用 "\|"

[ 本帖最后由 aman_cao 于 2010-1-29 09:30 编辑 ]
作者: fessor21    时间: 2010-2-1 18:26
谢谢 云层,版主,aman_cao,菜也快乐着,谢谢各位的热心回答。

问题解决了。云层的方法解决 了。这个问题初看需要转义,但实际上是page end. 所以右边只需要为空就可以。

最近在客户公司上班,上网受限,抱歉没能及时回复进度!




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