51Testing软件测试论坛

标题: 关联时遇到的问题~ [打印本页]

作者: cyk00    时间: 2010-3-3 10:13
标题: 关联时遇到的问题~
这是部分原代码


        web_custom_request("org.gocom.abframe.rights.menu.MenuManager.queryParentMenus.biz.ajax",
                "URL=http://192.168.0.5:7301/eos-default/common/skins/outlook/org.gocom.abframe.rights.menu.MenuManager.queryParentMenus.biz.ajax?time=Tue%20Mar%202%2016:59:40%20UTC+0800%202010",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/xml",
                "Referer=http://192.168.0.5:7301/eos-default/common/skins/outlook/work_body_leftTree.jsp?hrefStr=null&hrefPlanid=null&hrefDepkpiid=null&hrefGatherplanid=null&hrefAlertsoluinst=null",
                "Snapshot=t8.inf",
                "Mode=HTML",
                "EncType=application/x-www-form-urlencoded;charset=utf-8",
                "Body=<?xml version=\"1.0\" encoding=\"utf-8\"?><root><params></params>\n<data><menuid>5</menuid></data></root>",
                EXTRARES,
                "Url=css/panbg.gif", "Referer=http://192.168.0.5:7301/eos-default/common/skins/outlook/work_body_leftTree.jsp?hrefStr=null&hrefPlanid=null&hrefDepkpiid=null&hrefGatherplanid=null&hrefAlertsoluinst=null", ENDITEM,
                LAST);

        lr_think_time(9);

        web_submit_data("com.fhd.questionanswer.queAnswerSelectMain.flow_2",
                "Action=http://192.168.0.5:7301/eos-default/common/skins/outlook/com.fhd.questionanswer.queAnswerSelectMain.flow",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://192.168.0.5:7301/eos-default/common/skins/outlook/com.fhd.questionanswer.queAnswerSelectMain.flow",
                "Snapshot=t9.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=_eosFlowAction", "Value=evaluateQue", ENDITEM,
                "Name=viewType", "Value=1", ENDITEM,
                "Name=criteria/_expr[4]/operatorid", "Value=1040", ENDITEM,
                "Name=criteria/_expr[6]/ispublished", "Value=1", ENDITEM,
                "Name=criteria/_expr[3]/companyid", "Value=1", ENDITEM,
                "Name=criteria/_expr[3]/_op", "Value==", ENDITEM,
                "Name=criteria/_expr[5]/_op", "Value==", ENDITEM,
                "Name=criteria/_expr[4]/_op", "Value==", ENDITEM,
                "Name=criteria/_expr[5]/isenabled", "Value=1", ENDITEM,
                "Name=criteria/_entity", "Value=com.fhd.service.sdo.QuestionaireManagement.QV_Que_DepParticipant", ENDITEM,
                "Name=criteria/_expr[6]/_op", "Value==", ENDITEM,
                "Name=page/begin", "Value=0", ENDITEM,
                "Name=page/length", "Value=13", ENDITEM,
                "Name=page/count", "Value=4", ENDITEM,
                "Name=page/isCount", "Value=true", ENDITEM,
                "Name=QueSubStatus[2]", "Value=0", ENDITEM,
                "Name=select_objs[2]/targetstype", "Value=0", ENDITEM,
                "Name=select_objs[2]/depparticipantid", "Value=5B3018A4-D9BE-58E7-0A91-88D134CE9BBB", ENDITEM,
                "Name=select_objs[2]/questsetid", "Value=E7C0D450-D1C3-3C2F-55AF-274C2152D23E", ENDITEM,
                "Name=_eosFlowKey", "Value=0bfb1c42-328d-43df-9e1d-3e9e9d79d84e.view0", ENDITEM,
                EXTRARES,
                "Url=images/tabs/tabs_nomal_right.gif", ENDITEM,
                "Url=images/tabs/tabs_nomal_left.gif", ENDITEM,
                LAST);


我想将web_submit_data中的operatorid,depparticipantid,questsetid这几个值进行关联

我在request之前添加了以下函数:

web_reg_save_param("operaorid",
                "LB=operatorid\", \"Value=",
                "RB=\"",
                LAST);

        web_reg_save_param("depparticipantid",
                "LB=depparticipantid\", \"Value=",
                "RB=\"",
                LAST);

        web_reg_save_param("questsetid",
                "LB=questsetid\", \"Value=",
                "RB=\"",
                LAST);

并将web_submit_data中需要关联的部分进行了参数化

但是运行的时候报出了
No match found for the requested parameter "operaorid". 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          [MsgId: MERR-26377]
这个错误~


我不知道哪里出现了错误,是不是我这里还是不能用关联?
作者: tttrrryyy    时间: 2010-3-3 10:25
位置,左右边界,长度,关联的能错的地方就这三种,按顺序一个个对着检查吧
作者: cyk00    时间: 2010-3-3 10:38
标题: 回复 2# 的帖子
我查了一遍,感觉没什么问题的~
作者: skyzhu    时间: 2010-3-3 11:08
错误就是operaorid没找到,关联查找的源文件的是请求后返回的源代码,检查request返回的内容是否正确,左右边界如果有换行之类的也是要设置进去的
如果不想在找不到的情况下报错,就在web_reg_save_param中加一个参数
"Notfound=warning",
作者: cyk00    时间: 2010-3-3 11:12
标题: 回复 4# 的帖子
我要关联的operatorid就在这里
                "Name=viewType", "Value=1", ENDITEM,
                "Name=criteria/_expr[4]/operatorid", "Value=1040", ENDITEM,
                "Name=criteria/_expr[6]/ispublished", "Value=1", ENDITEM,

LB=operatorid\", \"Value
RB=\",

不应该没有找到啊~
作者: tttrrryyy    时间: 2010-3-3 11:19
看来你还没搞懂关联的原理,网上这方面的教材多的是,先看看吧
作者: cyk00    时间: 2010-3-3 11:36
标题: 回复 6# 的帖子
不太理解,能否帮忙说明一下,帮助我理解?
作者: cyk00    时间: 2010-3-3 12:06
标题: 回复 6# 的帖子
我这里的operatorid值在每个不同用户登录时,服务器会返回不同的值~所以要将其关联……
这里理解哪里不对么?
希望得到帮助
作者: prince198509    时间: 2010-3-3 12:27
关联是要从服务器返回的数据即HTML源码中根据左右边界来关联的,看你现在的关联是从你录制脚本中来确定左右边界关联的,对关联的理解有误
作者: cyk00    时间: 2010-3-3 12:37
标题: 回复 9# 的帖子
受教~谢谢




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