51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4003|回复: 3
打印 上一主题 下一主题

登录提交信息中有两处关联,应怎么手动关联第二处?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2004-11-10 16:37:07 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
登录提交信息中有两处关联,应怎么手动关联第二处?

请问各位高手,本人测试某网站的登录功能,但登录页面中必须输入已注册用户名、密码和校验码(登录页面每刷新一次,客户端就向服务器请求,服务器返回一个随机码);填写完三个信息后一并提交数据,经服务器验证无误后放转入相应页面。本人录制的脚本如下:
#include "as_web.h"
Action()
{
        web_set_max_html_param_len("1024");

        /* Registering parameter(s) from source task id 2
        // {JSESSIONID3} = "2021D41BFE52483418154E36FD876A2E"
        // */
        web_reg_save_param("JSESSIONID3",
                "LB/IC=jsessionid=",
                "RB/IC=\"",
                "Ord=1",
                "Search=body",
                "RelFrameId=1",
                LAST);

        // [WCSPARAM WCSParam_Diff1 32 2021D41BFE52483418154E36FD876A2E] Parameter {WCSParam_Diff1} created by Correlation Studio
        web_reg_save_param( "WCSParam_Diff1", "LB=Set-Cookie: JSESSIONID=", "RB=;", "Ord=1", "Search=Headers", "RelFrameId=1", LAST );
         
    web_reg_save_param("WCSParam_Diff2","LB=Value=","RB=\"","Ord=1","Search=body","RelFrameID=1",LAST);

    web_url("login.jsp",
                "URL=http://192.168.9.109/personnel/portal/login/login.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../images/bg.gif", ENDITEM,
                "Url=../images/top.gif", ENDITEM,
                "Url=../images/top.swf", "Referer=", ENDITEM,
                "Url=../images/ziye_left.gif", ENDITEM,
                "Url=../images/text_top.gif", ENDITEM,
                "Url=../images/text_title_wssb.gif", ENDITEM,
                "Url=../images/button.gif", ENDITEM,
                LAST);

        lr_think_time( 17 );

   
        web_submit_form("login.do;jsessionid={WCSParam_Diff1}",
                "Snapshot=t2.inf",
                ITEMDATA,
                "Name=username", "Value=testing", ENDITEM,
                "Name=pwd", "Value=12345", ENDITEM,
                "Name=checknum", "Value={WCSParam_Diff2}", ENDITEM,
                "Name=submit", "Value=µÇ ¼", ENDITEM,
                EXTRARES,
                "Url=portal/images/bg.gif", ENDITEM,
                "Url=portal/images/top.gif", ENDITEM,
                "Url=portal/images/top.swf", "Referer=", ENDITEM,
                "Url=portal/images/ziye_left.gif", ENDITEM,
                "Url=portal/images/text_title_wssb.gif", ENDITEM,
                "Url=portal/images/text_top.gif", ENDITEM,
                LAST);

        lr_think_time( 6 );

        web_link("Í˳öµÇ¼",
                "Text=Í˳öµÇ¼",
                "Snapshot=t3.inf",
                LAST);

        web_url("login.jsp_2",
                "URL=http://192.168.9.109/personnel/portal/login/login.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t4.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../images/top.gif", ENDITEM,
                "Url=../images/bg.gif", ENDITEM,
                "Url=../images/top.swf", "Referer=", ENDITEM,
                "Url=../images/ziye_left.gif", ENDITEM,
                "Url=../images/text_top.gif", ENDITEM,
                "Url=../images/text_title_wssb.gif", ENDITEM,
                "Url=../images/button.gif", ENDITEM,
                LAST);

        return 0;
}
第一处关联WCSParam_Diff1是lr自动关联的,第二处关联WCSParam_Diff2是本人手动加上去的,但无论怎么修改,运行时总报如下错误:
Action.c(28): Found resource "http://192.168.9.109/personnel/portal/images/bottom_bg.gif" in HTML "http://192.168.9.109/personnel/portal/login/login.jsp"          [MsgId: MMSG-26659]
Action.c(28): Error -27190: No match found for the requested parameter "WCSParam_Diff2". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 1024 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-27190]
Action.c(28): web_url highest severity level was "ERROR", 231859 body bytes, 2624 header bytes, 33 chunking overhead bytes          [MsgId: MMSG-27177]
Ending action Action.
Ending iteration 1.
……
不知道如何解决这种加密验证的录制问题,请各位高手指点小妹,刚学lr没多久,正在学习中。谢谢!期待着您们的答复。
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏

该用户从未签到

2#
 楼主| 发表于 2004-11-10 16:49:35 | 只看该作者
另外补充一点,我想问一下,以上脚本中的JSESSIONID3关联好像始终没用到?能把它删去吗?它有什么作用?
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2004-11-10 17:48:19 | 只看该作者
关注!第二个参数不能关联的原因,很有可能是你的第二个参数产生的值是与第一个参数以及登录的用户名有关的,第二个参数的值取决于第一个参数和用户输入的用户名。现在很多网站都有类似的保护机制。比如采用http协议录制126信箱的登录界面,脚本会录制一些Siebel_Analytic_search_id,当对登录用户名进行参数化以后,也是提示出现提示Siebel_Analytic_search_id上述的错误。

也希望有大虾能解决一下~~

[ Last edited by wghong on 2004-11-10 at 19:06 ]
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2004-11-11 06:19:50 | 只看该作者

手动关联好像根本不可用?!

我用load runner的sample application MercuryWebTours录了一小段,玩了一天也没搞明白,或者是明白了手动关联根本不可用?!!



Action1()
{
       
        web_reg_find("Text=Mercury Tours",
                LAST);

        web_url("MercuryWebTours",
                "URL=http://localhost/MercuryWebTours/",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t9.inf",
                "Mode=HTML",
                LAST);
//在此作search string, (由录制生成的),成功
        web_reg_find("Text=Mercury Tours",
                LAST);
//尝试把 上述String 中的 'y '设置到 testPara, it never works!!
web_reg_save_param( "testPara", "LB=Mercur","RB=Tours","Ord=1", "Search=BODY", "RelFrameId=1", LAST );
//after last line, in the output it says 'Registering web_reg_save_param was successful'
//however, the parameter never usable!?!!
//说是设置成功,但是此参数无论如何都是不可用?!!在output里{testPara}根本没有解析!!?
//Error -26627: HTTP Status-Code=404 (Not found) for "http://localhost/MercuryWebTours/{testPara}.html"


web_url("home.html",
                "URL=http://localhost/MercuryWebTours/{testPara}.html",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost/MercuryWebTours/welcome.pl?signOff=true",
                "Snapshot=t10.inf",
                "Mode=HTML",
                LAST);

        web_reg_find("Text=Mercury Tours Navigation Bar",
                LAST);

        web_url("nav.pl",
                "URL=http://localhost/MercuryWebTours/nav.pl?in=home",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://localhost/MercuryWebTours/welcome.pl?signOff=true",
                "Snapshot=t11.inf",
                "Mode=HTML",
                LAST);

        lr_think_time( 2 );

        web_reg_find("Text=Mercury Tours Admin Page",
                LAST);

        web_image("admin.gif",
                "Src=/MercuryWebTours/images/admin.gif",
                "Snapshot=t12.inf",
                LAST);

return 0;
}
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-9-21 12:38 , Processed in 0.069292 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表