51Testing软件测试论坛
标题:
关联问题,请高手指教
[打印本页]
作者:
apple2811
时间:
2007-6-5 16:24
标题:
关联问题,请高手指教
我录制的脚本,怎么也做不了关联。
上网查资料,看到一篇文章.
在Recording Log中找到了要找的数据,这时要确认数据是从服务器端传送过来的。首先可以先检查数据的标头,从标头的Receiving response可以知道数据是从服务器端传送到client端的。假如此数据第一次出现是在Sending request中,则表示此数据是由client端产生,不需要做关联,但是有可能需要做参数化(parameterized)。
您要找的标头格式如下:
*** [tid=b9 Action1 2] Receiving response from host astra.merc-int.com:80 ( 25/11/2002 12:04:00 )
我怎么没找到Receiving response 啊?
请问在哪里啊?
Action()
{
web_url("index.jsp",
"URL=http://www.mo-home.cn/web/index.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=image/body_bg.jpg", ENDITEM,
"Url=image/line.gif", ENDITEM,
LAST);
web_submit_form("login.jsp",
"Snapshot=t2.inf",
ITEMDATA,
"Name=userName", "Value=13556004244", ENDITEM,
"Name=userPWD", "Value=888888", ENDITEM,
"Name=code", "Value=4743", ENDITEM,
EXTRARES,
"Url=C_login/style.css", "Referer=http://www.mo-home.cn/web/C_login/index.jsp", ENDITEM,
"Url=C_login/images/left_bgmiddle.gif", "Referer=http://www.mo-home.cn/web/C_login/left.jsp", ENDITEM,
"Url=C_login/images/left_menubg.gif", "Referer=http://www.mo-home.cn/web/C_login/left.jsp", ENDITEM,
"Url=C_login/images/img.swf", "Referer=http://www.mo-home.cn/web/C_login/top.jsp", ENDITEM,
"Url=C_login/images/left_line1.gif", "Referer=http://www.mo-home.cn/web/C_login/left.jsp", ENDITEM,
"Url=C_login/images/main_bgtop1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/img.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/main_bgtop2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/main_bgmiddle.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/time_icon1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/daoheng_bg.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/next2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/last2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/img2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/main_line1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/last.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/next.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/btn1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
LAST);
web_link("业务查询",
"Text=业务查询",
"Snapshot=t3.inf",
EXTRARES,
"Url=../home_img/button_bg.gif", "Referer=http://www.mo-home.cn/web/OperTransact/tran4.jsp?epname=业务查询", ENDITEM,
LAST);
return 0;
}
作者:
apple2811
时间:
2007-6-5 16:26
标题:
我把以上的脚本加了关联,但是出错了,这个问题困饶了一个星期
Action()
{
web_add_cookie("entAccount=gdc; DOMAIN=www.mo-home.cn");
web_add_cookie("userName=13556004244; DOMAIN=www.mo-home.cn");
web_reg_save_param("sk","LB=Value=","RB=","ORD=1",LAST);
web_url("index.jsp",
"URL=http://www.mo-home.cn/web/index.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=image/body_bg.jpg", ENDITEM,
"Url=image/line.gif", ENDITEM,
LAST);
web_submit_form("login.jsp",
"Snapshot=t2.inf",
ITEMDATA,
"Name=userName", "Value=13556004244", ENDITEM,
"Name=userPWD", "Value=888888", ENDITEM,
"Name=code", "Value={sk}", ENDITEM,
EXTRARES,
"Url=C_login/style.css", "Referer=http://www.mo-home.cn/web/C_login/index.jsp", ENDITEM,
"Url=C_login/images/img.swf", "Referer=http://www.mo-home.cn/web/C_login/top.jsp", ENDITEM,
"Url=C_login/images/left_bgmiddle.gif", "Referer=http://www.mo-home.cn/web/C_login/left.jsp", ENDITEM,
"Url=C_login/images/left_menubg.gif", "Referer=http://www.mo-home.cn/web/C_login/left.jsp", ENDITEM,
"Url=C_login/images/left_line1.gif", "Referer=http://www.mo-home.cn/web/C_login/left.jsp", ENDITEM,
"Url=C_login/images/main_line1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/img.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/main_bgtop1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/daoheng_bg.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/img2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/main_bgmiddle.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/main_bgtop2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/last.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/time_icon1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/next.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/last2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=C_login/images/btn1.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
"Url=home_img/next2.gif", "Referer=http://www.mo-home.cn/web/C_login/main.jsp", ENDITEM,
LAST);
lr_think_time(4);
web_link("业务查询",
"Text=业务查询",
"Snapshot=t3.inf",
EXTRARES,
"Url=../home_img/button_bg.gif", "Referer=http://www.mo-home.cn/web/OperTransact/tran4.jsp?epname=业务查询", ENDITEM,
LAST);
web_url("logout.jsp",
"URL=http://www.mo-home.cn/web/logout.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=http://www.mo-home.cn/web/C_login/index.jsp",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_url("index.jsp_2",
"URL=http://www.mo-home.cn/web/index.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t5.inf",
"Mode=HTML",
LAST);
return 0;
}
作者:
qiguojie
时间:
2007-6-5 16:38
我建议你让开发人员把验证码功能去掉再录制;如果服务器返回的信息有验证码的明文信息,那么这个验证码也就没有什么用了。
或者做一个暗的,就是输入某个验证码,就可以直接登录,这样就不用考虑关联的问题了
另外,你的脚本中存在你帐号和密码,以后注意一下哦
作者:
apple2811
时间:
2007-6-5 16:52
好的,谢谢你
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2