51Testing软件测试论坛

标题: 如果Sessionid 不出现在脚本中,关联取不到值? [打印本页]

作者: fessor21    时间: 2010-1-27 18:42
标题: 如果Sessionid 不出现在脚本中,关联取不到值?
Sessionid 不出现在脚本中, 可以在
Generation log 查询到!这种情况不可以做关联?
如果处理呢?谢谢!
==
//1 define "Testform" to get the value of TestForm
web_reg_save_param("TestForm",
                "LB=TestFORM=",
                "RB=;",
                "Ord=1",
                "RelFrameId=1",
                "Search=Headers",
                "IgnoreRedirections=Yes",
               LAST);
              
//2. define "sessionid" to get the value of sessionid
    web_reg_save_param("sessionid",
                "LB=ASP.NET_SessionId=",
                "RB=;",
                "Ord=1",
                "RelFrameId=1",
                "Search=Headers",
                "IgnoreRedirections=Yes",
               LAST);
              
// 脚本中只录制到
web_add_cookie("TestFORM={TestForm}; DOMAIN=192.168.0.1");
=====================

/// Replay log:

Action.c(33): Error -26377: No match found for the requested parameter "TestForm". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
Action.c(33): Notify: Saving Parameter "TestForm = "
Action.c(33): Error -26377: No match found for the requested parameter "sessionid". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
Action.c(33): Notify: Saving Parameter "sessionid = "

/// Generation log:

***** Request Header For Transaction With Id 75 ******
GET /Testtest/images/Menu/payment.gif HTTP/1.1
Accept: */*
Referer: http://192.168.0.1/Testtest/home.aspx
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; CIBA; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 192.168.0.1
Connection: Keep-Alive
Cookie: TestFORM=2E14725C557DD95FE2F0C5DF99B4CB8AA9EEA6DDAF7799724A95E6761E214E5776EB28147778B1D1A59951C53E8A7F4F8AD78EF10ECC16CBBC96AB56C3FA88BD; ASP.NET_SessionId=etxx4n45b31nda45ywhinimz; Testuser=1; Testuserpwd=1

[ 本帖最后由 fessor21 于 2010-1-27 18:44 编辑 ]
作者: 云层    时间: 2010-1-27 19:55
这个sessionid是在cookie里面的?不过只要服务器返回都能抓到,也许你没找对地方而已
作者: fessor21    时间: 2010-1-27 20:08
只能从 replay 或者 generation log 中找到这个session id. 录制脚本并没有出现。只录制到这一句:

web_add_cookie("TestFORM=2E14725C557DD95FE2F0C5DF99B4CB8AA9EEA6DDAF7799724A95E6761E214E5776EB28147778B1D1A59951C53E8A7F4F8AD78EF10ECC16CBBC96AB56C3FA88BD; DOMAIN=192.168.0.1");
作者: fessor21    时间: 2010-1-27 22:01
是的,好像只出现在cookie. DoNet 这样处理的?
作者: fessor21    时间: 2010-1-28 10:31
改用URL方式录制脚本,response data 能找到一处sessionid,但运行后仍然找不到,各位这个问题有解吗?


==== A.脚本
//1. 设置关联
web_reg_save_param("sessionid",
                "LB=Set-Cookie: ASP.NET_SessionId=",
                "RB=; path",
        "Ord=1",
        "Search=Headers",
         LAST);
         
//2. 脚本中能录制到的,只有下面这一句
web_add_cookie("testFORM=4E3D99BD7A83A47E4F67CBE989DEA24D533F563BFEBE70560CB7E3CD4C1A008CC827AF2EA9ABDD0F2333A6EA9EEEFCEF164C26CDC49A484A02BC0A76A04B30A5; DOMAIN=192.168.1.20");
=== .脚本

== B. Replay Log:
vuser_init.c(23): Error -26377: No match found for the requested parameter "sessionid". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]


== C. generation log
****** Request Header For Transaction With Id 47 ******
GET /testtest/ValidateUser/Login.aspx HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*
Accept-Language: zh-cn
UA-CPU: x86
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; CIBA; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Host: 192.168.1.20
Connection: Keep-Alive
Cookie: testFORM=4E3D99BD7A83A47E4F67CBE989DEA24D533F563BFEBE70560CB7E3CD4C1A008CC827AF2EA9ABDD0F2333A6EA9EEEFCEF164C26CDC49A484A02BC0A76A04B30A5


$$$$$$ Request Header For Transaction With Id 47 Ended $$$$$$

****** Response Header For Transaction With Id 47 ******
HTTP/1.1 200 OK
Date: Thu, 28 Jan 2010 01:18:25 GMT
Server: Microsoft-IIS/6.0
MicrosoftOfficeWebServer: 5.0_Pub
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Set-Cookie: ASP.NET_SessionId=puyt0n55ahot3i55jhqpfn45; path=/; HttpOnly
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 7107

===generation log
作者: 森林一木    时间: 2010-1-28 11:37
你在tree视图下的server response 中找找。




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