51Testing软件测试论坛

标题: 这样的情况怎么关联 [打印本页]

作者: shgy984    时间: 2011-2-19 11:08
标题: 这样的情况怎么关联
1、页面已经加载完成
2、输入某个参数值A,点击页面的任意地方,系统自动关联出输入项参数B的值
   对于这种情况,请问应该怎么在脚本中关联参数B的值
(因公司不能上传文件,不能贴图,请见谅)

我录制时使用的HTML协议,在tree视图中,我在服务器的响应信息中找到了对应参数B的值
    value="2011011390755000701"
使用右键“Create Parameter” 添加了关联,可是回放时却关联不到,请高手解答一下,谢谢

Error -26377: No match found for the requested parameter "WCSParam_Text1". 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]
作者: shgy984    时间: 2011-2-19 12:11
lr_start_transaction("get_iccid");

        lr_think_time(28);

        web_submit_data("business.action_37",
                "Action=http://10.137.30.24:9080/Business/business.action?BMECID={WCSParam_Diff1}&BMETimestamp=1298010940276",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/plain",
                "Referer=http://10.137.30.24:9080/Business/business.action?BMECID={WCSParam_Diff1}&BMETimestamp=1298010795151",
                "Snapshot=t55.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=paramSubscriberList[0].defaultAcctCode", "Value=3.1139018", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.subLan", "Value=1", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.mobileNo", "Value={msisdn}", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.iccid", "Value=", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.packNo", "Value=", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.password", "Value=", ENDITEM,
                "Name=paramSubscriberList[0].tmpSubDataValue.confirmPwd", "Value=", ENDITEM,
                "Name=bmeEvent.mode", "Value=render", ENDITEM,
                "Name=bmeEvent.validation", "Value=false", ENDITEM,
                "Name=bmeEvent.targetid", "Value=subBaseGSM", ENDITEM,
                "Name=bmeEvent.service", "Value=BMEStep.processInputMSISDN", ENDITEM,
                "Name=BMEParam", "Value=%{paramSubscriberList[0].subscriber}", ENDITEM,
                LAST);

        // [WCSPARAM WCSParam_Text1 19 2011011390755000701] Parameter {WCSParam_Text1} created by Correlation Studio
        web_reg_save_param( "WCSParam_Text1", "LB=value=\"", "RB=\"", "Ord=1", LAST );

        web_submit_data("business.action_38",
                "Action=http://10.137.30.24:9080/Business/business.action?BMECID={WCSParam_Diff1}&BMETimestamp=1298010968994",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/plain",
                "Referer=http://10.137.30.24:9080/Business/business.action?BMECID={WCSParam_Diff1}&BMETimestamp=1298010795151",
                "Snapshot=t56.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=bmeEvent.mode", "Value=render", ENDITEM,
                "Name=bmeEvent.targetid", "Value=mobileNo_129801080951735965, iccid_129801080951735965, packNo_129801080951735965", ENDITEM,
                "Name=bmeEvent.regionid", "Value=", ENDITEM,
                "Name=bmeEvent.validation", "Value=false", ENDITEM,
                LAST);

        lr_message("value: %s",lr_eval_string("{WCSParam_Text1}"));

        lr_end_transaction("get_iccid",LR_AUTO);

        lr_start_transaction("open_fee_info");

        lr_think_time(30);

        web_submit_data("business.action_39",
                "Action=http://10.137.30.24:9080/Business/business.action?BMECID={WCSParam_Diff1}&BMETimestamp=1298010819714",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/plain",
                "Referer=http://10.137.30.24:9080/Business/business.action?BMECID={WCSParam_Diff1}&BMETimestamp=1298010795151",
                "Snapshot=t57.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=paramSubscriberList[0].defaultAcctCode", "Value=3.1139018", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.subLan", "Value=1", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.mobileNo", "Value={msisdn}", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.iccid", "Value={WCSParam_Text1}", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.packNo", "Value={msisdn}", ENDITEM,
                "Name=paramSubscriberList[0].subscriber.password", "Value=111111", ENDITEM,
                "Name=paramSubscriberList[0].tmpSubDataValue.confirmPwd", "Value=111111", ENDITEM,
                "Name=bmeEvent.mode", "Value=render", ENDITEM,
                "Name=bmeEvent.validation", "Value=false", ENDITEM,
                "Name=bmeEvent.targetid", "Value=errorMsgCellAlert", ENDITEM,
                "Name=bmeEvent.service", "Value=BMEStep.checkAccount", ENDITEM,
                LAST);
作者: andyguo    时间: 2011-2-19 12:29
web_reg_save_param( "WCSParam_Text1", "LB=value=\"", "RB=\"", "Ord=1", LAST );
这个关联是没问题,问题有可能是关联的左右边界有问题,这个可能性比较大,另一个,就是你设置的存储关联的变量设置的有点短,你可以修改一下web_set_max_html_param_len (“99999”),尝试一下试试,祝你好运
作者: shgy984    时间: 2011-2-19 14:03
我看到好多文档,web_reg_save_param都使用在web_url前的,我这个是从web_submit_data的服务器响应消息中取值,不知道有没有影响.你说的web_set_max_html_param_len 我之前就试过了,关联不到web_set_max_html_param_len("800000");
至于左右边界值,只是取  value="2011011390755000701"  里的值2011011390755000701,web_reg_save_param( "WCSParam_Text1", "LB=value=\"", "RB=\"", "Ord=1", LAST );应该不会有问题啊.Ord=ALL也设置过也是没有内容
作者: shgy984    时间: 2011-2-19 22:00
晕死了/少关联了一个前面其它的值,这个值老是出不来,难怪没关联出.
作者: msnshow    时间: 2011-2-20 12:08
回复 4# shgy984


   与你这里说的是否在web_url前没关系
作者: msnshow    时间: 2011-2-20 12:09
回复 5# shgy984


    找到原因就好,在脚本增强的时候需要比较细心,否则出了问题再查原因比较费时




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