51Testing软件测试论坛

标题: 求教lr对于cookie记录的session的关联问题 [打印本页]

作者: cooljw    时间: 2013-9-2 10:58
标题: 求教lr对于cookie记录的session的关联问题
单位新上的系统是通过cookie中的JSESSIONID来记录服务器返回的session的,每次交易服务器对cookie中记录的session进行校验,现在想关联该session,可lr录制脚本中录不到session,只有web_add_cookie函数,求教怎样才能将cookie中的JSESSIONID关联到,谢谢!

/*++++++++generationlog++++++*/

Code generation version: 11.0.0.8859

****** Request Header For Transaction With Id 90 ******
GET /cas/login?service=http%3A%2F%2Fmallyc.icbc.com.cn%3A8180%2Fj_spring_cas_security_check HTTP/1.1
Accept: */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Accept-Encoding: gzip, deflate
Host: login.mallyc.icbc.com.cn:8010
Connection: Keep-Alive
Cookie: __auc=6459bcf613f74b92b93a22ff222


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

****** Response Header For Transaction With Id 90 ******
HTTP/1.1 200 OK
Date: Wed, 28 Aug 2013 09:47:49 GMT
Server: IBM_HTTP_Server
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: no-cache
Cache-Control: no-store
Content-Length: 7082
Set-Cookie: JSESSIONID=0000FwOWXgKOzoSkIMfhyfOzD31:-1; Path=/
Keep-Alive: timeout=10, max=100
Connection: Keep-Alive
Content-Type: text/html;charset=UTF-8
Content-Language: zh-CN

****** Add Event For Transaction With Id 91 ****** (Location Flag : tFlagInsertEnd, Location ID : 91)
        web_url("商城用户登录",
                "URL=http://login.mallyc.icbc.com.cn:8010/cas/login?service=http%3A%2F%2Fmallyc.icbc.com.cn%3A8180%2Fj_spring_cas_security_check",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t46.inf",
                "Mode=HTTP",
                LAST);


$$$$$$ Add Event For Transaction With Id 91 Ended $$$$$$

****** Request Header For Transaction With Id 95 ******
GET /cas/styles/base.css HTTP/1.1
Accept: */*
Referer: http://login.mallyc.icbc.com.cn: ... _cas_security_check
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
Accept-Encoding: gzip, deflate
Host: login.mallyc.icbc.com.cn:8010
Connection: Keep-Alive
Cookie: __auc=6459bcf613f74b92b93a22ff222; JSESSIONID=0000FwOWXgKOzoSkIMfhyfOzD31:-1


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

****** Response Header For Transaction With Id 95 ******
HTTP/1.1 200 OK
Date: Wed, 28 Aug 2013 09:47:49 GMT
Server: IBM_HTTP_Server
Last-Modified: Sat, 24 Aug 2013 10:32:18 GMT
Content-Length: 4294
Keep-Alive: timeout=10, max=99
Connection: Keep-Alive
Content-Type: text/css
Content-Language: zh-CN



/*++++++++Action.c++++++++*/
web_add_cookie("__auc=6459bcf613f74b92b93a22ff222; DOMAIN=mallyc.icbc.com.cn");

//        lr_think_time(25);

        web_submit_data("login_2",
                "Action=http://login.mallyc.icbc.com.cn:8010/cas/login?service=http%3A%2F%2Fmallyc.icbc.com.cn%3A8180%2Fj_spring_cas_security_check",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://login.mallyc.icbc.com.cn:8010/cas/login?service=http%3A%2F%2Fmallyc.icbc.com.cn%3A8180%2Fj_spring_cas_security_check",
                "Snapshot=t91.inf",
                "Mode=HTTP",
                ITEMDATA,
                "Name=username", "Value=13300000003", ENDITEM,
                "Name=password", "Value=123456", ENDITEM,
                "Name=j_captcha", "Value=1111", ENDITEM,
                "Name=lt", "Value=LT-31-oR5MgZax9FCh4Q3qfusAhdclGPwc1I", ENDITEM,
                "Name=execution", "Value=e1s1", ENDITEM,
                "Name=_eventId", "Value=submit", ENDITEM,
                "Name=service", "Value=http://mallyc.icbc.com.cn:8180/index.jhtml", ENDITEM,
                LAST);
作者: cooljw    时间: 2013-9-2 14:35
自re
作者: cooljw    时间: 2013-9-3 06:43
真的很急,拜托各位了
作者: San_Mingli    时间: 2015-6-2 01:03

请问你这问题如何解决的?
作者: jiazhiyong_zx    时间: 2016-5-23 09:25
请问楼主,该问题解决了没?
貌似我现在也遇到了该问题。
作者: cs3423493    时间: 2016-6-20 11:03
楼主大大  后来这个问题是如何解决的
作者: sheldontest    时间: 2016-6-20 11:55
cookie一定是保存在某个响应里面的,不存在找不到,只是要看是在响应体还是头
作者: 随落叶飘散    时间: 2016-8-23 19:35
楼主问题解决了吗




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