51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2953|回复: 2
打印 上一主题 下一主题

[原创] 关联做不了,在脚本中找不到SESSION ID

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2011-12-9 11:22:07 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 iceboy_361 于 2011-12-9 11:23 编辑

1.用html方式录制,回放时出现问题,尝试做关联解决

Action.c(199): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://172.16.1.101:8090/ph/*.js?temp=1323341878078"

[MsgId: MERR-26612]

Action.c(199): web_custom_request("*.js") highest severity level was "ERROR", 0 body bytes, 286 header bytes

[MsgId: MMSG-26388]


Action.c(199): Notify: Transaction "LOGIN" ended with "Fail" status (Duration: 0.0630 Wasted Time: 0.0039).

2.在generation log中 找到
****** Response Header For Transaction With Id 40 ******
HTTP/1.1 200 OK
Date: Thu, 08 Dec 2011 10:57:08 GMT
Server: IBM_HTTP_Server
Vary: Accept-Encoding
x-response-code: 200
x-response-msg: Success
Content-Length: 75
Set-Cookie: JSESSIONID=0000-kfdZo77pd70ICsy-4AZGyI:16f358bhi; Path=/
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Cache-Control: no-cache="set-cookie, set-cookie2"
Keep-Alive: timeout=10, max=95
Connection: Keep-Alive
Content-Type: text/javascript






****** Request Header For Transaction With Id 43 ******
POST /ph/*.jsonRequest?temp=1323341865629 HTTP/1.1
Accept: */*
Accept-Language: zh-cn
Referer: http://172.16.1.101:8090/ph/
Content-Type: application/json
encoding: utf-8
Accept-Encoding: gzip, deflate
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; Media Center PC 6.0; InfoPath.3; .NET4.0C; MALC)
Host: 172.16.1.101:8090
Content-Length: 50
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=0000-kfdZo77pd70ICsy-4AZGyI:16f358bhi

3.response和request中都存在 JSESSIONID=0000-kfdZo77pd70ICsy-4AZGyI:16f358bhi,且对应,对 JSESSIONID做关联
4.但脚本中提交的请求都为
web_custom_request("*.jsonRequest",
  "URL=http://172.16.1.101:8090/ph/*.jsonRequest?temp=1323341855551",
  "Method=POST",
  "Resource=0",
  "RecContentType=text/javascript",
  "Referer=http://172.16.1.101:8090/ph/",
  "Snapshot=t17.inf",
  "Mode=HTTP",
  "EncType=application/json",
  "Body={\"serviceId\":\"logon\",\"uid\":\"\",\"psw\":\"\",\"rid\":\"\",\"deep\":false,\"forConfig\":true,\"replace\":true}",
  LAST);


web_custom_request("*.jsonRequest_2",
  "URL=http://172.16.1.101:8090/ph/*.jsonRequest?temp=1323341865629",
  "Method=POST",
  "Resource=0",
  "RecContentType=text/javascript",
  "Referer=http://172.16.1.101:8090/ph/",
  "Snapshot=t18.inf",
  "Mode=HTTP",
  "EncType=application/json",
  "Body={\"serviceId\":\"rolesLoader\",\"uid\":\"CYMYL\",\"psw\":\"\"}",
  LAST);

的形式
5.问题:整个脚本中找不到0000-kfdZo77pd70ICsy-4AZGyI:16f358bhi的值,无法替代做关联,recording log中也没有,为[Web Request      (1eb0: 868)] "POST /ph/*.jsonRequest?temp=1323341855551"  的形式;
是否和web_custom_request中的temp=1323341865629有关?在GENERATION LOG中得RESPONSE里也找不到1323341865629的值。

请教各位大侠问题可能出在哪里。。谢谢了
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

3#
发表于 2011-12-9 13:28:07 | 只看该作者
将请求的时Cookie作为关联源,然后,在需要用到Cookie的请求前加请求头试试吧
web_add_header("Cookie", lr_eval_string("{关联参数}"));
回复 支持 反对

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2011-12-9 11:24:28 | 只看该作者
回复 1# iceboy_361


    URL方式录制时也是此问题
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-9-20 10:35 , Processed in 0.100707 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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