51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3756|回复: 4
打印 上一主题 下一主题

登录sessionid关联问题解决

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2005-11-29 09:35:49 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#include "as_web.h"


Action()
{
        web_set_max_html_param_len("1024");

        /* Registering parameter(s) from source task id 2
        // {JSESSIONID6} = "C0314DE1FBED450F036691152FF5A5AE?action=logon"
        // */
        web_reg_save_param("JSESSIONID6",
                "LB/IC=jsessionid=",
                "RB/IC=\"",
                "Ord=1",
                "Search=body",
                "RelFrameId=1",
                LAST);

        web_url("Login.do",
                "URL=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../images/egip/login/login-i_r1_c4.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login-i_r2_c1.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login.swf", "Referer=", ENDITEM,
                "Url=../images/egip/login/login_r4_c5.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login-i_r3_c4.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login-bu.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                LAST);

        lr_think_time( 4 );

        web_submit_data("Login.do;jsessionid=C0314DE1FBED450F036691152FF5A5AE",
                "Action=http://192.168.1.203:8090/goa/admin/Login.do;jsessionid={JSESSIONID6}",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024",
                "Snapshot=t2.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=password", "Value=123", ENDITEM,
                "Name=user_pin", "Value=", ENDITEM,
                "Name=sign_cert", "Value=", ENDITEM,
                "Name=enc_cert", "Value=", ENDITEM,
                "Name=userKeyID", "Value=", ENDITEM,
                "Name=KeyType", "Value=", ENDITEM,
                "Name=userId", "Value=8609", ENDITEM,
                "Name=pinpassword", "Value=123", ENDITEM,
                "Name=pinword", "Value=", ENDITEM,
                "Name=screenXY", "Value=1024", ENDITEM,
                EXTRARES,
                "Url=../images/egip/images/bn.swf", "Referer=", ENDITEM,
                "Url=../images/menu/bg_b.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/msgloadpage.jsp", ENDITEM,
                LAST);

        web_url("menudata.jsp",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/menudata.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop",
                "Snapshot=t3.inf",
                "Mode=HTML",
                LAST);

        web_url("cardcontent.do",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t4.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/goa/images/egip/images/bjtbl.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop", ENDITEM,
                LAST);

        web_url("msgplan.jsp",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/msgplan.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/egip/mainpage/msgloadpage.jsp",
                "Snapshot=t5.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/goa/images/egip/main_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/mail_atth.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/deskpic_7.jpg", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/images/td_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/webui/calendar/menuarrow.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                LAST);

        web_url("hiddenleft.do",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/hiddenleft.do?rnd=1133227579464",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop",
                "Snapshot=t6.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/goa/images/egip/images/td_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/images/bjtbl.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop", ENDITEM,
                "Url=/goa/images/deskpic_7.jpg", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/main_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/webui/calendar/menuarrow.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                LAST);

        lr_think_time( 1 );

        web_url("Login.do_2",
                "URL=http://192.168.1.203:8090/goa/admin/Login.do?action=logout2&menuClickCounter=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t7.inf",
                "Mode=HTML",
                LAST);

        return 0;
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2005-11-29 09:44:06 | 只看该作者
单个用户回放报错如下:(同时弹出“当前安全设置禁止运行页中的ActiveX控件,因此,该页无法正常显示”)

Action.c(37): web_submit_data highest severity level was "ERROR", 75957 body bytes, 7176 header bytes, 56 chunking overhead bytes          [MsgId: MMSG-27177]
Ending action Action.
Ending iteration 1.
因为脚本中存在动态信息jsessionid=C0314DE1FBED450F036691152FF5A5AE(每次都不一样),需要设置关联。
lr_think_time( 4 );

        web_submit_data("Login.do;jsessionid=C0314DE1FBED450F036691152FF5A5AE",
                "Action=http://192.168.1.203:8090/goa/admin/Login.do;jsessionid={JSESSIONID6}",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024",
                "Snapshot=t2.inf",
                "Mode=HTML",
录制完脚本后自动设置关联后脚本如下:
Action()
{
        web_set_max_html_param_len("1024");

        /* Registering parameter(s) from source task id 2
        // {JSESSIONID6} = "C0314DE1FBED450F036691152FF5A5AE?action=logon"
        // */
        web_reg_save_param("JSESSIONID6",
                "LB/IC=jsessionid=",
                "RB/IC=\"",
                "Ord=1",
                "Search=body",
                "RelFrameId=1",
                LAST);

        // [WCSPARAM WCSParam_Diff1 32 C0314DE1FBED450F036691152FF5A5AE] 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_url("Login.do",
                "URL=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../images/egip/login/login-i_r1_c4.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login-i_r2_c1.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login.swf", "Referer=", ENDITEM,
                "Url=../images/egip/login/login_r4_c5.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login-i_r3_c4.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                "Url=../images/egip/login/login-bu.gif", "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024", ENDITEM,
                LAST);

        lr_think_time( 4 );

        web_submit_data("Login.do;jsessionid={WCSParam_Diff1}",
                "Action=http://192.168.1.203:8090/goa/admin/Login.do;jsessionid={JSESSIONID6}",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/admin/Login.do?action=welcome&screenXY=1024",
                "Snapshot=t2.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=password", "Value=123", ENDITEM,
                "Name=user_pin", "Value=", ENDITEM,
                "Name=sign_cert", "Value=", ENDITEM,
                "Name=enc_cert", "Value=", ENDITEM,
                "Name=userKeyID", "Value=", ENDITEM,
                "Name=KeyType", "Value=", ENDITEM,
                "Name=userId", "Value=8609", ENDITEM,
                "Name=pinpassword", "Value=123", ENDITEM,
                "Name=pinword", "Value=", ENDITEM,
                "Name=screenXY", "Value=1024", ENDITEM,
                EXTRARES,
                "Url=../images/egip/images/bn.swf", "Referer=", ENDITEM,
                "Url=../images/menu/bg_b.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/msgloadpage.jsp", ENDITEM,
                LAST);

        web_url("menudata.jsp",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/menudata.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop",
                "Snapshot=t3.inf",
                "Mode=HTML",
                LAST);

        web_url("cardcontent.do",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t4.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/goa/images/egip/images/bjtbl.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop", ENDITEM,
                LAST);

        web_url("msgplan.jsp",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/msgplan.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/egip/mainpage/msgloadpage.jsp",
                "Snapshot=t5.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/goa/images/egip/main_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/mail_atth.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/deskpic_7.jpg", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/images/td_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/webui/calendar/menuarrow.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                LAST);

        web_url("hiddenleft.do",
                "URL=http://192.168.1.203:8090/goa/egip/mainpage/hiddenleft.do?rnd=1133227579464",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop",
                "Snapshot=t6.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=/goa/images/egip/images/td_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/images/bjtbl.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/main.do?action=toMainTop", ENDITEM,
                "Url=/goa/images/deskpic_7.jpg", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/images/egip/main_bg.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                "Url=/goa/webui/calendar/menuarrow.gif", "Referer=http://192.168.1.203:8090/goa/egip/mainpage/cardcontent.do?cardmode=1&rnd=1133227567917", ENDITEM,
                LAST);

        lr_think_time( 1 );

        web_url("Login.do_2",
                "URL=http://192.168.1.203:8090/goa/admin/Login.do?action=logout2&menuClickCounter=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t7.inf",
                "Mode=HTML",
                LAST);

        return 0;
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2005-11-29 09:53:08 | 只看该作者
设置关联后仍报错如下:
ror -26627: HTTP Status-Code=404 (/hotkey.jsp) for "http://192.168.1.203:8090/goa/hotkey.do"          [MsgId: MERR-26627]Action.c(39): Found resource "http://192.168.1.203:8090/goa/images/menu/but.gif" in HTML "http://192.168.1.203:8090/goa/egip/mainpage/msgloadpage.jsp"          [MsgId: MMSG-26659]
Action.c(39): Detected non-resource "http://192.168.1.203:8090/goa/egip/mainpage/msgplan.jsp" in "http://192.168.1.203:8090/goa/egip/mainpage/msgloadpage.jsp"          [MsgId: MMSG-26574]
Action.c(39): Downloading resource "http://192.168.1.203:8090/goa/images/menu/bg_b.gif" (specified by argument number 43)          [MsgId: MMSG-26577]
Action.c(39): web_submit_data highest severity level was "ERROR", 75957 body bytes, 7176 header bytes, 56 chunking overhead bytes          [MsgId: MMSG-27177]Ending action Action.
Ending iteration 1.
Ending Vuser...
请教各位高手,是否web_reg_save_param中参数自动设置参数LB、RB不对?这里的左边界"LB=Set-Cookie: JSESSIONID=", 若设置成"LB=JSESSIONID=",   是否会与另外 {JSESSIONID6}的混淆?web_reg_save_param( "WCSParam_Diff1", "LB=Set-Cookie: JSESSIONID=", "RB=;", "Ord=1", "Search=Headers", "RelFrameId=1", LAST );

web_reg_save_param("JSESSIONID6","LB/IC=jsessionid=","RB/IC=\"", "Ord=1", "Search=body", "RelFrameId=1",LAST);
回复 支持 反对

使用道具 举报

该用户从未签到

4#
发表于 2005-11-29 12:24:24 | 只看该作者
给你点建议:因为你的第二个帖子上说了,(同时弹出“当前安全设置禁止运行页中的ActiveX控件,因此,该页无法正常显示”)所以,你先把你的设置改动一下,在internet的属性里,不会找别人问问,然后你的参数都是用jsessionid取值,看起来别扭,自动设置关联参数好象没错。
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2005-11-29 13:04:07 | 只看该作者
在internet的安全属性里设置所有ActiveX为启动后,仍弹出“当前安全设置禁止运行页中的ActiveX控件,因此,该页无法正常显示”。
查看运行提示,Submit Data: Login.do;jsessionid={WCSParam_Diff1} Web step failed Failed 12:51:28

我估计是两个关联取值存在问题;{WCSParam_Diff1} 与{JSESSIONID6}的左边界 无法区别?"LB=Set-Cookie: JSESSIONID=",  与  "LB/IC=jsessionid=",

调试中。。。。。。!
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-23 07:24 , Processed in 0.072323 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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