51Testing软件测试论坛

标题: 为什么设置参数化后,运行脚本时仍然跑的是录制值? [打印本页]

作者: caohanqin    时间: 2007-10-25 17:45
标题: 为什么设置参数化后,运行脚本时仍然跑的是录制值?
为什么设置参数化后,运行脚本时仍然跑的是录制值?
新手上路,请多指教,谢谢.
作者: caohanqin    时间: 2007-10-26 09:40
没有人愿意帮忙?
作者: higkoo    时间: 2007-10-29 21:15
原帖由 caohanqin 于 2007-10-26 09:40 发表
没有人愿意帮忙?



可能你的参数化设置有问题,论坛里有很多参数化的帖子,仔细看看是哪搞错了。
作者: 阳光_测试    时间: 2007-10-30 10:34
你的参数选择机制有问题,看一下LR的中文手册里边有这些说明!
作者: dengzhi    时间: 2007-10-30 12:15
我的问题跟你一样啊
设置参数化,就比如一个登陆。设置了一些能正确登陆的参数,和一些错误的参数。但回放脚本的时候,它依然可以通过。郁闷。。。。。
作者: fox-huling    时间: 2007-10-30 13:04
如果你进行了关联就有可能出现这种情况,因为进行关联之后LR会保存登录的SESSION,所以查看下你的脚本,如果在login.jsp前有这样一句话
// [WCSPARAM WCSParam_Diff1 32 AB04F3D1D1F4F02AE9ABF50196DD46C6] Parameter {WCSParam_Diff1} created by Correlation Studio
        web_reg_save_param("WCSParam_Diff1",
就把它删除掉,然后再进行参数化设置
作者: dengzhi    时间: 2007-10-30 14:26
没有出现楼上所说的情况啊
作者: 兰色犹豫    时间: 2007-10-30 14:30
你把角本贴上来吧,你这么一说,没办法啊
作者: dengzhi    时间: 2007-10-31 21:45
#include "web_api.h"


Action()
{
        web_add_cookie("logType=df; DOMAIN=www.126.com");
        web_add_cookie("nts_mail_user=; DOMAIN=www.126.com");
        web_add_cookie("NETEASE_SSN=jiale_huang; DOMAIN=www.126.com");
        web_add_cookie("MAIL126_SSN=jiale_huang; DOMAIN=www.126.com");
        web_add_cookie("logType=df; DOMAIN=mimg.126.com");
        web_add_cookie("nts_mail_user=; DOMAIN=mimg.126.com");
        web_add_cookie("NETEASE_SSN=jiale_huang; DOMAIN=mimg.126.com");
        web_add_cookie("MAIL126_SSN=jiale_huang; DOMAIN=mimg.126.com");
        web_url("www.126.com",
                "URL=http://www.126.com/",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://mimg.126.com/index/bg_x.jpg", ENDITEM,
                "URL=http://mimg.126.com/index/new.gif", ENDITEM,
                "URL=http://mimg.126.com/index/bg.png", ENDITEM,
                LAST);
        lr_think_time(7);
        web_add_cookie("logType=df; DOMAIN=g1a76.mail.126.com");
        web_add_cookie("nts_mail_user=; DOMAIN=g1a76.mail.126.com");
        web_add_cookie("NETEASE_SSN=jiale_huang; DOMAIN=g1a76.mail.126.com");
        web_add_cookie("MAIL126_SSN=jiale_huang; DOMAIN=g1a76.mail.126.com");
        web_submit_data("login",
                "Action=http://entry.mail.126.com/cgi/login?hid=10010102&lightweight=1&language=0&style=-1",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://www.126.com/",
                "Snapshot=t2.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=domain", "Value=126.com", ENDITEM,
                "Name=language", "Value=0", ENDITEM,
                "Name=bCookie", "Value=", ENDITEM,
                "Name=user", "Value={zh}", ENDITEM,
                "Name=pass", "Value={ewr}", ENDITEM,
                "Name=style", "Value=-1", ENDITEM,
                "Name=enter.x", "Value=登 录", ENDITEM,
                LAST);
        web_add_cookie("wmsvr_domain=g1a76.mail.126.com; DOMAIN=g1a76.mail.126.com");
        web_add_cookie("mail_style=js3; DOMAIN=g1a76.mail.126.com");
        web_url("index_v4.htm",
                "URL=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/p/main.htm?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul",
                "Snapshot=t3.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/f1.gif", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/f2.gif", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/f1png.png", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/ico.gif", ENDITEM,
                "URL=urlconfig_v3.xml", ENDITEM,
                "URL=http://mimg.163.com/ggimg/all/img/0905_wel_UP.gif", ENDITEM,
                "URL=http://p.mail.163.com/js31style/js/0709061733/address.js", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/wel_2.gif", ENDITEM,
                "URL=http://p.mail.163.com/js31style/js/0709061733/option.js", ENDITEM,
                LAST);
        web_url("servdata.html",
                "URL=http://g1a76.mail.126.com/a/p/servdata.html?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/p/main.htm?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul",
                "Snapshot=t4.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/cmcss/126_green_s.css", "Referer=http://g1a76.mail.126.com/a/p/servdata.html?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/loading_body_theme.gif", "Referer=http://g1a76.mail.126.com/a/p/servdata.html?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/loading.gif", "Referer=http://g1a76.mail.126.com/a/p/servdata.html?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul", ENDITEM,
                "URL=http://p.mail.163.com/js31style/lib/0709071745/126green/loading_bottxt.gif", "Referer=http://g1a76.mail.126.com/a/p/servdata.html?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul", ENDITEM,
                LAST);
        web_url("htmltool_js3.htm",
                "URL=http://g1a76.mail.126.com/a/f/js3/0709061733/htmltool_js3.htm",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t5.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://p.mail.163.com/js31style/lib/images/editor/mtoolallbg5.gif", ENDITEM,
                LAST);
        web_url("history.htm",
                "URL=http://g1a76.mail.126.com/a/f/js3/0709061733/history.htm",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t6.inf",
                "Mode=HTML",
                LAST);
        web_custom_request("s",
                "URL=http://g1a76.mail.126.com/a/s?sid=hBCaaqlleKdXobXYMCllyaVJvBGHWRul&func=global:sequential",
                "Method=POST",
                "Resource=1",
                "RecContentType=text/javascript",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "EncType=application/xml",
                "Body=<?xml version=\"1.0\"?><object><array name=\"items\"><object><string name=\"func\">pab:searchContacts</string><object name=\"var\"><array name=\"order\"><object><string name=\"field\">FN</string><boolean name=\"ignoreCase\">true</boolean></object></array></object></object><object><string name=\"func\">user:getSignatures</string></object><object><string name=\"func\">pab:getAllGroups</string></object></array></object>",
                LAST);
        web_add_cookie("wmsvr_domain=g1a76.mail.126.com; DOMAIN=mimg.126.com");
        web_add_cookie("mail_style=js3; DOMAIN=mimg.126.com");
        web_url("126tab.htm",
                "URL=http://mimg.126.com/pm/share/126tab.htm",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t7.inf",
                "Mode=HTML",
                LAST);
        web_url("wel_img_ifm_126.htm",
                "URL=http://popme.163.com/netease/mail/wel_img_ifm_126.htm",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t8.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://mimg.163.com/ggimg/all/img/0905_wel_LB_30x30_2.gif", ENDITEM,
                "URL=http://proimg.163.com/channel6/ebay/nation7070928_126_mail_30x30.gif", ENDITEM,
                LAST);
        web_add_cookie("NGUserID=c0a81e99-14638-1193836053-6; DOMAIN=pro.163.com");
        web_url("site=netease&affiliate=freemail126&cat=login&type=pip300x260&location=1",
                "URL=http://pro.163.com/html.ng/site=netease&affiliate=freemail126&cat=login&type=pip300x260&location=1",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t9.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://proimg.163.com/channel1/ms/300x260_25k.swf", ENDITEM,
                "URL=http://mccannafa7.allyes.com/main/adfshow?local=blank.swf", ENDITEM,
                LAST);
        web_url("126one.html",
                "URL=http://popme.163.com/netease/126one.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t10.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://mimg.163.com/ggimg/all/img/if_icon_188.gif", ENDITEM,
                LAST);
        web_url("59287.html",
                "URL=http://mimg.126.com/tianqi/city/59287.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t11.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=http://mimg.163.com/jsstyle/jscss/cm25js_weather.css", ENDITEM,
                "URL=../njs/js.js", ENDITEM,
                LAST);
        web_url("history.htm_2",
                "URL=http://g1a76.mail.126.com/a/f/js3/0709061733/history.htm?0",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t12.inf",
                "Mode=HTML",
                LAST);
        web_url("126hotone.html",
                "URL=http://popme.163.com/netease/mail/126hotone.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://mimg.126.com/pm/share/126tab.htm",
                "Snapshot=t13.inf",
                "Mode=HTML",
                LAST);
        web_url("126hottwo.html",
                "URL=http://popme.163.com/netease/mail/126hottwo.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://mimg.126.com/pm/share/126tab.htm",
                "Snapshot=t14.inf",
                "Mode=HTML",
                LAST);
        web_url("126two.html",
                "URL=http://popme.163.com/netease/126two.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t15.inf",
                "Mode=HTML",
                LAST);
        web_url("59287_small.html",
                "URL=http://mimg.126.com/tianqi/city/59287_small.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t16.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=../images/ico_weather.gif", ENDITEM,
                LAST);
        web_url("13090_126c.html",
                "URL=http://popme.163.com/netease/mail/13090_126c.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://g1a76.mail.126.com/a/f/js3/0709061733/index_v4.htm",
                "Snapshot=t17.inf",
                "Mode=HTML",
                LAST);
        web_add_cookie("ALLYESID4=00071031210822102388992; DOMAIN=mccannafa7.allyes.com");
        web_url("adfshow",
                "URL=http://mccannafa7.allyes.com/main/adfshow?user=MccannAfa7|VOG_163|126mail_PIP_300x260_25k&db=mccannafa7&border=0&local=yes&js=ie",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://pro.163.com/html.ng/site=netease&affiliate=freemail126&cat=login&type=pip300x260&location=1",
                "Snapshot=t18.inf",
                "Mode=HTML",
                LAST);
        return 0;
}
作者: dengzhi    时间: 2007-10-31 21:46
作了参数化~~参数都是错的~
但回放脚本的时候,他也一样能通过.
什么问题啊
作者: fish_yy    时间: 2007-10-31 22:16
这是因为你没有迭代啊!
作者: 阳光_测试    时间: 2007-11-1 09:54
你这个脚本太乱了,看不出来问题,




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