51Testing软件测试论坛

标题: LR参数化问题 [打印本页]

作者: jaxcon    时间: 2009-6-1 17:21
标题: LR参数化问题
LR参数化脚本后,回放不走参数列表?请问是不是我哪设置得不对,只有原录制的那个一参数可以;

我这人系统是录入个人资料,关键字是身份证号,我改变就是身份证参数;
eb_submit_data("InsertItemTrain.aspx",
                "Action=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15448&isSeriesNo=false",
                "Method=POST",
                "EncType=multipart/form-data",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15448&isSeriesNo=false",
                "Snapshot=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__EVENTTARGET", "Value=", ENDITEM,
                "Name=__EVENTARGUMENT", "Value=", ENDITEM,
                "Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState4}", ENDITEM,
                "Name=RadFormDecorator1_ClientState", "Value=", ENDITEM,
                "Name=MainRadWindowManager_ClientState", "Value=", ENDITEM,
                "Name=txtCardNumBase", "Value={NewParam}", ENDITEM,
                "Name=btnCheckCardNum", "Value=楠岃瘉 >>", ENDITEM,
                "Name=txtSeriesNo", "Value=", ENDITEM,
                "Name=txtName", "Value=", ENDITEM,
                "Name=txtIdentity", "Value=", ENDITEM,
                "Name=fileUpload", "Value=", "File=yes", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWDAKsiZXVDAKBrNSSAgLt252FDQKuk6fDCgKF9IT6BQLEhISFCwKOsfKTCQLvjry/BQLt3oXMAwLCi9reAwL+6YyoCgKK+sjUBw==", ENDITEM,
                LAST);

        web_add_cookie("__utmb=148375159.5.10.1243838888; DOMAIN=192.168.0.19");


        web_custom_request("GetIdentityInfo.aspx",
                "URL=http://192.168.0.19:801/web/GetIdentityInfo.aspx?cerf={NewParam}",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15448&cerf_num=440437197007150553&isSeriesNo=false",
                "Snapshot=t5.inf",
                "Mode=HTML",
                "EncType=",
                EXTRARES,
                "URL=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=305894421&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmhid=2080727530&utmr=0&utmp=/web/Training/InsertItemTrainNext.aspx?course_id=15448&cerf_num=440437197007150553&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.2369720308651925500.1243224185.1243838632.1243838888.39%3B%2B__utmz%3D148375159.1243224185.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15448&cerf_num=440437197007150553&isSeriesNo=false", ENDITEM,
                "URL=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPRCiRxsHOph7cP7ScPQhlrMZVOSZGybfsrtbmnjRTKf0lg2sBhJY08w5IE-bSUUoIEQS8SigDwcVRqkjFdc2icy0&t=633718639428503750", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15448&cerf_num=440437197007150553&isSeriesNo=false", ENDITEM,
                LAST);
        lr_think_time(14);

[ 本帖最后由 jaxcon 于 2009-6-1 17:22 编辑 ]
作者: iori    时间: 2009-6-1 17:38
你回放几次?
作者: 云层    时间: 2009-6-1 17:43
你在run上设置x3那么参数就会取3个
作者: 忍忍忍    时间: 2009-6-1 17:46
这段脚本是否放在action下面 ?
另外你看一下run-time setting设置脚本迭代次数是多少,如果是一次,那么执行每次都只能取到第一个身份证号。

你可以在参数下面写个打印语句观察一下不同迭代次数的取值情况(lr_error_message)
作者: Eric2515    时间: 2009-6-1 18:45
RUN TIME SETTINGS改成3次.
或者外面加个循环.并且把UPDATE VALUE ON改成Each occurance.
作者: wangshuman    时间: 2009-6-2 09:45
查看虚拟用户数,如果只有一个虚拟用户你必须增加迭代次数,如果三个虚拟用户你必须修改UPDATE VALUE ON 的值为Each occurance,其实你可以点击simulate parameter按钮查看一下参数具体是怎么分配的
作者: jaxcon    时间: 2009-6-2 09:51
标题: 谢谢各位的回答
谢谢各位的回答,
我这个脚本是在action里面的,迭代也设置了3次,
无论我将录制时的身份证放在参数列表的哪个位置,回放3次,都只有这一个记录有插入;
其它的身份证就是没有记录,
而且我用参数表替换了所有脚本出现的那个身份证号,回放结果也一样!
看看我还有什么没做好的!

作者: jaxcon    时间: 2009-6-2 10:28
试过了,用另一身份证号直接替换脚本里的所有原录制的身份证,也是没记录出来,这也是太奇怪了
作者: jaxcon    时间: 2009-6-2 10:54
难道是乱码的缘故,?是不是有这个可能,大哥?这个检查语句的中文乱码了!
作者: jaxcon    时间: 2009-6-2 11:13
标题: 回复 12# 的帖子
一直有打开那个页面刷新查看,就是没记录,,,就是只有录制时的那个记录;
作者: jaxcon    时间: 2009-6-2 11:44
噢,,display过程中,是发生未知错误,
作者: jaxcon    时间: 2009-6-2 12:10
可以帮忙看看是怎么回事吗?这是全部的脚本过程
Action()
{web_add_cookie("__utmb=148375159.3.10.1242892714; DOMAIN=192.168.0.19");
web_set_max_html_param_len("2432");
lr_think_time(4);
web_url("InsertItemTrain.aspx",
                "URL=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/ItemMain.aspx",
                "Snapshot=t3.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../Picture/Imgs/pici_top.gif", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false", ENDITEM,
                "Url=../picture/DataGrid.htc", "Referer=", ENDITEM,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=1784487331&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmdt=%E6%97%A0%E6%A0%87%E9%A2%98%E9%A1%B5&utmhid=2051461590&utmr=0&utmp=/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.3796988193712948700.1242885152.1242892668.1242892714.3%3B%2B__utmz%3D148375159.1242885152.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none"
                ")%3B", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false", ENDITEM,
                LAST);
        web_add_cookie("__utmb=148375159.4.10.1242892714; DOMAIN=192.168.0.19");
       
        web_reg_save_param("Siebel_Analytic_ViewState5",
                "LB/IC=ViewState\" value=\"",
                "RB/IC=\"",
                "Ord=1",
                "Search=Body",
                "RelFrameId=1",
                LAST);
        web_submit_form("InsertItemTrain.aspx_2",
                "Snapshot=t4.inf",
                ITEMDATA,
                "Name=txtCardNumBase", "Value={NewParam}", ENDITEM,
                "Name=txtSeriesNo", "Value=", ENDITEM,
                "Name=txtName", "Value=", ENDITEM,
                "Name=txtIdentity", "Value=", ENDITEM,
                "Name=fileUpload", "Value=", "File=Yes", ENDITEM,
                "Name=btnCheckCardNum", "Value=楠岃瘉 >>", ENDITEM,
                LAST);
        web_add_cookie("__utmb=148375159.5.10.1242892714; DOMAIN=192.168.0.19");
        web_custom_request("GetIdentityInfo.aspx",
                "URL=http://192.168.0.19:801/web/GetIdentityInfo.aspx?cerf={NewParam}",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false",
                "Snapshot=t5.inf",
                "Mode=HTML",
                "EncType=",
                EXTRARES,
                "Url=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPRCiRxsHOph7cP7ScPQhlrMZVOSZGybfsrtbmnjRTKf0lg2sBhJY08w5IE-bSUUoIEQS8SigDwcVRqkjFdc2icy0&t=633718639428503750", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=261845572&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmhid=465529509&utmr=0&utmp=/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.3796988193712948700.1242885152.1242892668.1242892714.3%3B%2B__utmz%3D148375159.1242885152.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B", "Refere"
                "r=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                LAST);

        lr_think_time(13);

        web_submit_data("InsertItemTrainNext.aspx",
                "Action=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false",
                "Method=POST",
                "EncType=multipart/form-data",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false",
                "Snapshot=t6.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__EVENTTARGET", "Value=", ENDITEM,
                "Name=__EVENTARGUMENT", "Value=", ENDITEM,
                "Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState5}", ENDITEM,
                "Name=RadFormDecorator1_ClientState", "Value=", ENDITEM,
                "Name=MainRadWindowManager_ClientState", "Value=", ENDITEM,
                "Name=GDTempWorker1:txtName", "Value=11111", ENDITEM,
                "Name=GDTempWorker1:txtFileNum", "Value=11111", ENDITEM,
                "Name=GDTempWorker1:txtNation", "Value=11111", ENDITEM,
                "Name=GDTempWorker1:ddlCultID", "Value=1", ENDITEM,
                "Name=GDTempWorker1:ddlSex", "Value=0", ENDITEM,
                "Name=GDTempWorker1:txtHomePhone", "Value=111111", ENDITEM,
                "Name=GDTempWorker1:txtBirthday", "Value=1977-8-3", ENDITEM,
                "Name=GDTempWorker1:filPhoto", "Value=", "File=Yes", ENDITEM,
                "Name=GDTempWorker1:txtNative", "Value=骞夸笢鐪佹繁鍦冲競", ENDITEM,
                "Name=GDTempWorker1:txtContact", "Value=111111", ENDITEM,
                "Name=GDTempWorker1:ddlType", "Value=1", ENDITEM,
                "Name=GDTempWorker1:txtYear", "Value=2000", ENDITEM,
                "Name=GDTempWorker1:txtAddress", "Value=骞夸笢鐪佹繁鍦冲競", ENDITEM,
                "Name=GDTempWorker1:ckbIaGrant", "Value=on", ENDITEM,
                "Name=GDTempWorker1:txtMemo", "Value=浠\\x8E2000骞村紑濮嬩粠浜嬪缓绛戣\xA1\x8C涓\\x9A.", ENDITEM,
                "Name=btnSave", "Value=淇\\x9D 瀛\\x98", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWUgL9wsj1BAKGqquZCALQu9DZDwKXoMnwCAKcueXuBgLY95qPCQLZ95qPCQLa95qPCQLb95qPCQLc95qPCQLd95qPCQLe95qPCQLP95qPCQLA95qPCQL3wuL/BgLowuL/"
"
                "jlBQLG4LurCAKct7iSDALomq/CAw==", ENDITEM,
                LAST);

        web_add_cookie("__utmb=148375159.6.10.1242892714; DOMAIN=192.168.0.19");

        web_custom_request("GetIdentityInfo.aspx_2",
                "URL=http://192.168.0.19:801/web/GetIdentityInfo.aspx?cerf={NewParam}",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false",
                "Snapshot=t7.inf",
                "Mode=HTML",
                "EncType=",
                EXTRARES,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=1306772078&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmhid=495174213&utmr=0&utmp=/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.3796988193712948700.1242885152.1242892668.1242892714.3%3B%2B__utmz%3D148375159.1242885152.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B", "Refer"
                "er=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                "Url=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPT5QaToJeKTPg7ZPqjXhUq4Tuln-DhDMD_RTu1aXGsEMA2&t=633718639428503750", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                "Url=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPT5QaToJeKTPg7ZPqjXhUq4ScWv6PwZNAJYQIt67m2LG1lWpDUTHgdu3e1WEmsEkiU1&t=633718639428503750", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                "Url=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPT5QaToJeKTPg7ZPqjXhUq4QHyJ4qJel2gsgkLkyAEyIw2&t=633718639428503750", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                "Url=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPT5QaToJeKTPg7ZPqjXhUq4xp9tfLQ_K4BGtt2lAv0WV0cGtZmD5t-vX_tsSOMM2Ew1&t=633718639428503750", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num={NewParam}&isSeriesNo=false", ENDITEM,
                "Url=../WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-
                LAST);

        web_url("InsertItemTrain.aspx_3",
                "URL=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.19:801/web/Training/ItemIndex.aspx",
                "Snapshot=t8.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=486454126&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmdt=%E6%97%A0%E6%A0%87%E9%A2%98%E9%A1%B5&utmhid=1945061648&utmr=0&utmp=/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.3796988193712948700.1242885152.1242892668.1242892714.3%3B%2B__utmz%3D148375159.1242885152.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)"
                "%3B", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15468&isSeriesNo=false", ENDITEM,
                LAST);

        return 0;
}
作者: jaxcon    时间: 2009-6-2 13:50
已经设置过,只解决登陆部份中文不乱码,,进入后,还是乱码!
作者: test_test81    时间: 2009-6-2 17:54
我以前好像也遇到过类似的问题,可能与关联设置有关!!!
作者: Eric2515    时间: 2009-6-2 20:03
你把LR的日志打开.然后COPY出来给我看看。
作者: 木可    时间: 2009-6-2 22:46
问下手动输入你列表中的省份证号码有成功吗?
作者: jaxcon    时间: 2009-6-3 09:21
请问兄台,关联处理,具体要怎么做?,
脚本语言不怎么会看呀!
作者: jaxcon    时间: 2009-6-3 09:23
标题: 回复 22# 的帖子
没成功过,列表中只要不是录制的那个身份证号,就不行!
作者: jaxcon    时间: 2009-6-3 09:40
标题: 回复 21# 的帖子
这是回放的部份日志,应该是这里出错,但不知道怎么修改!
Action.c(128): Warning -26490: File name in a multipart submit is missing or empty. Using an empty file          [MsgId: MWAR-26490]
Action.c(128): Downloading resource "http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=2063863945&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmhid=625753486&utmr=0&utmp=/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num=440724198309131533&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.2369720308651925500.1243224185.1243991431.1243991642.58%3B%2B__utmz%3D148375159.1243224185.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B" (specified by argument number 78)          [MsgId: MMSG-26577]
Action.c(128): Redirecting "http://192.168.0.19:801/web/Training/InsertItemTrainNext.aspx?course_id=15468&cerf_num=440724198309131533&isSeriesNo=false" (redirection depth is 0)          [MsgId: MMSG-26694]
Action.c(128): To location "http://192.168.0.19:801/web/error.htm?id=8025"          [MsgId: MMSG-26693]
作者: wgx2345    时间: 2009-6-3 09:54
感觉应该是关联的问题吧
作者: jaxcon    时间: 2009-6-3 10:18
我发现,
测试的系统,录入身份证,生日就自动关联了身份证里的日期,是不是这个问题,使回放提交不了正确数据,所以不成功呢?
应该要怎么做才可以成功使用参数列表回放呢?
作者: kuangquanshui    时间: 2009-6-3 10:35
兄弟  你这个问题我也遇见过  我对一些数据都做了参数化 可是就是不好用  后来我明白了  有时候系统开发的时候会设置一些特殊字段  而录制的时候也录制下来了   但我们没注意  比如用户ID这类东西  所以建议你试试是不是有某个数据还需要共同的参数化   你参数化得数据不全  检查一下   看看是否好用
作者: Eric2515    时间: 2009-6-3 10:36
web_reg_save_param("Siebel_Analytic_ViewState5",
                "LB/IC=ViewState\" value=\"",
                "RB/IC=\"",
                "Ord=1",
                "Search=Body",
                "RelFrameId=1",
                LAST);
你在这里建立了关联..然后用web_url去GET你想要得到参数的那个页面。
作者: jaxcon    时间: 2009-6-3 10:46
嗯,,谢谢各位大哥的引导先,!!
不懂之处还要各位前辈的指导!

[ 本帖最后由 jaxcon 于 2009-6-8 12:18 编辑 ]
作者: jaxcon    时间: 2009-6-8 12:16
标题: 请问这是报什么错?
Action.c(60): Resource "http://192.168.0.19:801/web/Scripts/ga.js" is in the cache already and will not be downloaded again          [MsgId: MMSG-26655]
Action.c(60): Error -26377: No match found for the requested parameter "Siebel_Analytic_ViewState4". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 3168 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
Action.c(60): web_link("录入资料") highest severity level was "ERROR", 34991 body bytes, 1525 header bytes          [MsgId: MMSG-26388]

作者: guoxianchina    时间: 2009-6-8 15:11
如果脚本回放没有新记录生成,肯定是脚本回放有报错。尽管有些脚本错误只出现vuer_init
,action却可以顺利通过,那也没有用,因为init都没成功。
作者: jaxcon    时间: 2009-6-8 15:59
标题: 回复 32# 的帖子
我全部脚本都在action里的哟,参数化后回放报红色字错#
作者: guoxianchina    时间: 2009-6-8 16:07
尝试把web_set_max_html_param_len()设置的大一些
作者: jaxcon    时间: 2009-6-8 16:28
标题: 回复 34# 的帖子
试过效果一样,
作者: kuangquanshui    时间: 2009-6-8 16:32
学习中。。。。。
作者: kpsz202    时间: 2009-6-10 21:11
原帖由 Eric2515 于 2009-6-3 10:36 发表
web_reg_save_param("Siebel_Analytic_ViewState5",
                "LB/IC=ViewState\" value=\"",
                "RB/IC=\"",
                "Ord=1",
                "Search=Body",
            ...



从错误提示来看,上面的见意是没错,应从这里下手找原因
作者: jaxcon    时间: 2009-6-11 17:12
嗯,不过本人的脚修改能力有限,学习脚本关联修改中,
另外我使用了自动关联,发现我们这个系统真是神,居然发现要N多的关联,被吓一跳,各位请查看一下!
web_reg_save_param("CSRule_1_UID5",
                "LB= value=\"",
                "RB=\"",
                "Ord=5",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        web_url("ItemLogin.aspx",
                "URL=http://192.168.0.19:801/web/Training/ItemLogin.aspx",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../Picture/Imgs/login_bg.gif", ENDITEM,
                "Url=../Picture/ModalDialogAlert.gif", ENDITEM,
                "Url=/WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPRCiRxsHOph7cP7ScPQhlrMpyhVzyeRGTL8J4TwZWUo1Xu1EnDMzwRw1ktW9FBGp7A1&t=633718639428503750", ENDITEM,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=239420248&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmdt=%E5%B9%B3%E5%AE%89%E5%8D%A1%E7%BD%91%E4%B8%8A%E6%8A%A5%E5%90%8D&utmhid=492705696&utmr=-&utmp=/web/Training/ItemLogin.aspx&utmac=UA-6771362-2&utmcc=__utma%3D148375159.2369720308651925500.1243224185.1244602081.1244603015.80%3B%2B__utmz%3D148375159.1243224185.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B", ENDITEM,
                "Url=/WebResource.axd?d=pQU6MJPbodMbEKQ1LuEnQe-KN8qpbleUoXCKbxBOxPR6jDv5pcG_K_M5H2dGkD9iY2uHAo15PM7mzrppbvhBFHMSvLjW094tivQ4Cm6TZB81&t=633718639428503750", ENDITEM,
                LAST);

        web_submit_form("ItemLogin.aspx_2",
                "Snapshot=t2.inf",
                ITEMDATA,
                "Name=txtUS_Name", "Value=jaxcon", ENDITEM,
                "Name=txtPass_Word", "Value=123", ENDITEM,
                "Name=btnLogin", "Value={CSRule_1_UID5}", ENDITEM,
                EXTRARES,
                "Url=../Picture/Imgs/top_bg0.gif", "Referer=http://192.168.0.19:801/web/Training/ItemIndex.aspx", ENDITEM,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=702716767&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmdt=%E5%B9%B3%E5%AE%89%E5%8D%A1%E7%BD%91%E4%B8%8A%E6%8A%A5%E5%90%8D%E7%B3%BB%E7%BB%9F&utmhid=873620568&utmr=0&utmp=/web/Training/ItemIndex.aspx&utmac=UA-6771362-2&utmcc=__utma%3D148375159.2369720308651925500.1243224185.1244602081.1244603015.80%3B%2B__utmz%3D148375159.1243224185.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D"
                "(none)%3B", "Referer=http://192.168.0.19:801/web/Training/ItemIndex.aspx", ENDITEM,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=154699563&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmhid=1233056540&utmr=0&utmp=/web/Training/ItemMain.aspx&utmac=UA-6771362-2&utmcc=__utma%3D148375159.2369720308651925500.1243224185.1244602081.1244603015.80%3B%2B__utmz%3D148375159.1243224185.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B", "Referer=http://192.168.0.19:801/web/Training/ItemMain.aspx", ENDITEM,
                LAST);

        web_add_cookie("__utmb=148375159.3.10.1244603015; DOMAIN=192.168.0.19");

        /* Registering parameter(s) from source task id 52
        // {CSRule_1_UID21} = "/wEPDwUINjA2ODcyMDQPZBYCAgMPFgIeB2VuY3R5cGUFE211bHRpcGFydC9mb3JtLWRhdGEWDgIBDw8WAh4XRW5hYmxlQWpheFNraW5SZW5kZXJpbmdoZGQCAg8PFgQeDFJlbG9hZE9uU2hvd2cfAWhkZAIED2QWBAIBDxYCHglpbm5lcmh0bWwFHuS6uuWRmOaho+ahiOS/oeaBr+W9leWFpemhtemdomQCAw8WAh8DBQYmbmJzcDtkAgYPZBYCZg9kFgICAQ8PFgIeCFJlYWRPbmx5aGRkAhIPZBYEAgEPFgIfAwVNW+Wkqeays+S9k+iCsuS4nOW3peeoi+WFrOWPuDAwNDRfMjAwOTA2MDVfTjA4NTg1MF3mibnmrKHkurrlkZjliJfooaggWyAw5Lq6IF1kAgMPFgIfAwUGJm5ic3A7ZAIaDzwrAAsBAA8WCB4IRGF0YUtleXMWAB4LXyFJdGVtQ291bnRmHglQYWdlQ291bnQCAR4VXyFEYXRhU291cmNlSXRlbUNvdW50ZmRkAhsPDxYCHgdFbmFibGVkaGRkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYCBRFSYWRGb3JtRGVjb3JhdG9yMQUUTWFpblJhZFdpbmRvd01hbmFnZXI="
        // */

        web_reg_save_param("CSRule_1_UID21",
                "LB= value=\"",
                "RB=\"",
                "Ord=3",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 52
        // {CSRule_1_UID29} = "/wEWDALgnrjRCwKBrNSSAgLt252FDQKuk6fDCgKF9IT6BQLEhISFCwKOsfKTCQLvjry/BQLt3oXMAwLCi9reAwL+6YyoCgKK+sjUBw=="
        // */

        web_reg_save_param("CSRule_1_UID29",
                "LB= value=\"",
                "RB=\"",
                "Ord=13",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        web_link("录入资料",
                "Text=录入资料",
                "Snapshot=t3.inf",
                EXTRARES,
                "Url=../Picture/Imgs/pici_top.gif", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15488&isSeriesNo=false", ENDITEM,
                "Url=../picture/DataGrid.htc", "Referer=", ENDITEM,
                "Url=http://www.google-analytics.com/__utm.gif?utmwv=4.3&utmn=1875815025&utmhn=192.168.0.19&utmcs=utf-8&utmsr=1280x1024&utmsc=32-bit&utmul=zh-cn&utmje=1&utmfl=10.0%20r22&utmdt=%E6%97%A0%E6%A0%87%E9%A2%98%E9%A1%B5&utmhid=756772309&utmr=0&utmp=/web/Training/InsertItemTrain.aspx?course_id=15488&isSeriesNo=false&utmac=UA-6771362-2&utmcc=__utma%3D148375159.2369720308651925500.1243224185.1244602081.1244603015.80%3B%2B__utmz%3D148375159.1243224185.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none"
                ")%3B", "Referer=http://192.168.0.19:801/web/Training/InsertItemTrain.aspx?course_id=15488&isSeriesNo=false", ENDITEM,
                LAST);

        web_add_cookie("__utmb=148375159.4.10.1244603015; DOMAIN=192.168.0.19");

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID48} = "4"
        // */

        web_reg_save_param("CSRule_1_UID48",
                "LB= value=\"",
                "RB=\"",
                "Ord=9",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID47} = "3"
        // */

        web_reg_save_param("CSRule_1_UID47",
                "LB= value=\"",
                "RB=\"",
                "Ord=8",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID45} = "1"
        // */

        web_reg_save_param("CSRule_1_UID45",
                "LB= value=\"",
                "RB=\"",
                "Ord=6",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID85} = "18"
        // */

        web_reg_save_param("CSRule_1_UID85",
                "LB= value=\"",
                "RB=\"",
                "Ord=54",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID51} = "7"
        // */

        web_reg_save_param("CSRule_1_UID51",
                "LB= value=\"",
                "RB=\"",
                "Ord=12",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID49} = "5"
        // */

        web_reg_save_param("CSRule_1_UID49",
                "LB= value=\"",
                "RB=\"",
                "Ord=10",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID52} = "8"
        // */

        web_reg_save_param("CSRule_1_UID52",
                "LB= value=\"",
                "RB=\"",
                "Ord=13",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID79} = "38"
        // */

        web_reg_save_param("CSRule_1_UID79",
                "LB= value=\"",
                "RB=\"",
                "Ord=48",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID97} = "50"
        // */

        web_reg_save_param("CSRule_1_UID97",
                "LB= value=\"",
                "RB=\"",
                "Ord=68",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID88} = "19"
        // */

        web_reg_save_param("CSRule_1_UID88",
                "LB= value=\"",
                "RB=\"",
                "Ord=57",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID46} = "2"
        // */

        web_reg_save_param("CSRule_1_UID46",
                "LB= value=\"",
                "RB=\"",
                "Ord=7",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID73} = "16"
        // */

        web_reg_save_param("CSRule_1_UID73",
                "LB= value=\"",
                "RB=\"",
                "Ord=42",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID54} = "0"
        // */

        web_reg_save_param("CSRule_1_UID54",
                "LB= value=\"",
                "RB=\"",
                "Ord=15",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID53} = "9"
        // */

        web_reg_save_param("CSRule_1_UID53",
                "LB= value=\"",
                "RB=\"",
                "Ord=14",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID66} = "12"
        // */

        web_reg_save_param("CSRule_1_UID66",
                "LB= value=\"",
                "RB=\"",
                "Ord=34",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID61} = "24"
        // */

        web_reg_save_param("CSRule_1_UID61",
                "LB= value=\"",
                "RB=\"",
                "Ord=29",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID77} = "32"
        // */

        web_reg_save_param("CSRule_1_UID77",
                "LB= value=\"",
                "RB=\"",
                "Ord=46",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID84} = "10"
        // */

        web_reg_save_param("CSRule_1_UID84",
                "LB= value=\"",
                "RB=\"",
                "Ord=53",
                "Search=Body",
                "RelFrameId=1",
                LAST);

        /* Registering parameter(s) from source task id 59
        // {CSRule_1_UID94} = "20"
        // */
下面还有一半,不够长度粘上来!
作者: pangxiong    时间: 2009-6-13 19:28
标题: 应该参数的取值方式设置的不对
参数列表看起来不起作用,应该是取值方式设置错误,取值方式可能是选择了Sequential和Once
如果将来的场景中只是用一个用户跑脚本的话,脚本中的参数属性取值方式应该设置为Sequential和Each iteration
如果是多个用户跑脚本,并且每个用户取的值都不相同的话,脚本中的参数属性取值方式应该设置为Unique和Each iteration
作者: jaxcon    时间: 2009-6-15 16:58
标题: 回复 39# 的帖子
我试过用上面的几种取值方式都不行;
现在我用自动联关录制脚本后,奇怪的是,不是每次都能成功回放参数化表,
录制时的行为动作是一样的,真是怪;
有时只要调大web_set_max_html_param_len("2456")里的值就可以正常回放参化表;
请大家交流经验;
作者: Fin    时间: 2009-6-15 17:11
试着看一下你的 COOKIES ,这个也需要关联..
作者: xinfeiyu520    时间: 2009-9-22 16:26
学习中..........
作者: huipeng    时间: 2009-9-25 21:53
标题: sdff
在脚本里插入下面代码,在回放log里可以看到每次的用户名取值

lr_log_message("用户名:%s",lr_eval_string("{NewParam}");




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