51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 5110|回复: 12
打印 上一主题 下一主题

[原创] http response是重定向的,如何用web_reg_save_para做关联

[复制链接]
  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2009-6-12 23:23:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    一般资料上说的web_reg_save_para都是直接从下一次访问的reponse获得关联值,我现在遇到一个问题,这下一次的response本身只是一个server端的redirect,我要获得的关联值在再下一次的response中,此时我如何做关联。谢谢啦。
    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

    该用户从未签到

    2#
    发表于 2009-6-12 23:39:33 | 只看该作者
    你能确定 下一次的RESPONSE 的页面里面你要关联的东西在HTML 页面里面的位置吗? 如果可以用 web_reg_find() 试一试,但愿可行...
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    3#
     楼主| 发表于 2009-6-12 23:49:05 | 只看该作者
    我在extended log中发现我录制只生成一个web_url(...),其实执行了两次,在服务器端产生了两个response,一个是redirect,一个是包含我要关联的response.所以我关心如何捕获。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
    发表于 2009-6-13 00:04:16 | 只看该作者
    那就在那个 response 上面加 这两个函数任意一个就可以吧...
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    5#
     楼主| 发表于 2009-6-13 00:06:58 | 只看该作者
    第二个真实的response在我客户端没有对应的http request呀。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    6#
    发表于 2009-6-13 00:12:31 | 只看该作者
    我也搞不清了, 你录制的是什么啊? 如果可能的话,给我个地址,我是否能登录,我去录制,或者把代码发上来这样也方便与问题排查.
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    7#
     楼主| 发表于 2009-6-13 00:13:24 | 只看该作者
    我明天9点贴代码。谢谢。晚安。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    8#
    发表于 2009-6-13 00:22:09 | 只看该作者
    88
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    9#
     楼主| 发表于 2009-6-13 09:18:45 | 只看该作者
    10点到10点半贴出代码
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    10#
     楼主| 发表于 2009-6-13 12:59:08 | 只看该作者
    我写的要关联的LR脚本: (左边数字是行号)
    65:        web_reg_save_param("lt1",
                    "LB/IC=login2.asp?lt=",
                    "RB/IC=%3a",
                    "Ord=1",
                    "Search=All",
                    LAST);

    72:        web_reg_save_param("lt2",
                    "LB/IC=%3a",
                    "RB/IC=%3a",
                    //"Ord=1",
                    "Search=All",
                    LAST);

    79:        web_reg_save_param("lt3",
                    "LB/IC=%3a",
                    "RB/IC=&service=",
                    //"Ord=1",
                    LAST);

    85:        web_url("IndexIframeLogin.asp",
                    "URL=http://www.s00.com/IndexIframeLogin.asp",
                    "Resource=0",
                    "RecContentType=text/html",
                    "Referer=http://www.s00.com/",
                    //"Snapshot=t26.inf",
                    "Snapshot=t26.inf",
                    "Mode=HTTP",
            //"Mode=HTML",
                    LAST);
    95:        lr_output_message("%s", lr_eval_string("{lt1}"));
    96:        lr_output_message("%s", lr_eval_string("{lt2}"));
    97:        lr_output_message("%s", lr_eval_string("{lt3}"));
    107:                    web_concurrent_end(NULL);

    如果我在run time setting 设置standard log:
    Action.c(72): Registering web_reg_save_param was successful          [MsgId: MMSG-26390]
    Action.c(79): Registering web_reg_save_param was successful          [MsgId: MMSG-26390]
    Action.c(85): Registering web_url("IndexIframeLogin.asp") was successful          [MsgId: MMSG-26390]
    Action.c(95):
    Action.c(96):
    Action.c(97):
    Action.c(85): Redirecting "http://www.sdo.com/IndexIframeLogin.asp" (redirection depth is 0)   [issued at Action.c(107)]          [MsgId: MMSG-26694]
    Action.c(85): To location "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp"   [issued at Action.c(107)]          [MsgId: MMSG-26693]
    Action.c(107): web_concurrent_end was successful, 5827 body bytes, 2152 header bytes, 12 chunking overhead bytes          [MsgId: MMSG-26385]
    我从Generated Log中得到的日志:其实我要访问的 URL=http://www.sdo.com/IndexIframeLogin.asp, 服务器端跳转到了http://lt.cas.sdo.com:8171/cas/login?

    ****** Request Header For Transaction With Id 38 ******
    GET /IndexIframeLogin.asp HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
    Referer: http://www.sdo.com/
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
    Host: www.sdo.com
    Connection: Keep-Alive
    Cookie: ASPSESSIONIDCQTBTCDT=CGCENDKABDKPILBBMOCIBCDJ


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

    ****** Response Header For Transaction With Id 38 ******
    HTTP/1.1 302 Object moved
    Server: sdo
    Date: Fri, 12 Jun 2009 07:54:16 GMT
    Content-Type: text/html
    Connection: keep-alive
    Via: www1
    Pragma: No-Cache
    Location: http://lt.cas.sdo.com:8171/cas/l ... ndexIframeLogin.asp
    Content-Length: 205
    Expires: Thu, 11 Jun 2009 07:54:16 GMT
    Set-Cookie: refererURL=http%253A%2F%2Fwww%2Esdo%2Ecom%2FIndexIframeLogin%2Easp; domain=sdo.com; path=/
    Cache-control: no-cache


    $$$$$$ Response Header For Transaction With Id 38 Ended $$$$$$

    ****** Response Body For Transaction With Id 38 ******
    <head><title>Object moved</title></head>
    <body><h1>Object Moved</h1>This object may be found <a HREF="http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp">here</a>.</body>

    $$$$$$ Response Body For Transaction With Id 38 Ended $$$$$$

    ****** Start Log Message ******

    Start Frames Hierarchy Tree Dump
    /
    End Frames Hierarchy Tree Dump

    $$$$$$ End Log Message $$$$$$

    ****** Request Header For Transaction With Id 40 ******
    GET /images/bg1.gif HTTP/1.1
    Accept: */*
    Referer: http://www.sdo.com/
    Accept-Language: zh-cn
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
    Host: www.sdo.com
    Connection: Keep-Alive
    Cookie: ASPSESSIONIDCQTBTCDT=CGCENDKABDKPILBBMOCIBCDJ


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

    ****** Response Header For Transaction With Id 40 ******
    HTTP/1.1 200 OK
    Server: sdo
    Date: Fri, 12 Jun 2009 07:54:16 GMT
    Content-Type: image/gif
    Connection: keep-alive
    Cache-Control: max-age=1296000
    Via: www3
    Content-Length: 1271
    Last-Modified: Tue, 20 Jan 2009 15:22:08 GMT
    Accept-Ranges: bytes
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2015-8-13 05:45
  • 签到天数: 2 天

    连续签到: 2 天

    [LV.1]测试小兵

    11#
     楼主| 发表于 2009-6-13 13:10:08 | 只看该作者
    还有用extended log好象是取到关联值了, 我想问一下,我到底是否取到关联值了呢?

    Action.c(85): t=4019ms: 394-byte request headers for "http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=7)   [issued at Action.c(107)]
    Action.c(107):     GET /IndexIframeLogin.asp HTTP/1.1\r\n
    Action.c(107):     Referer: http://www.sdo.com/\r\n
    Action.c(107):     Accept-Language: zh-cn\r\n
    Action.c(107):     User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatibl
    Action.c(107):     e; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; InfoPath.2)\r\n
    Action.c(107):     Accept-Encoding: gzip, deflate\r\n
    Action.c(107):     Accept: */*\r\n
    Action.c(107):     Connection: Keep-Alive\r\n
    Action.c(107):     Host: www.sdo.com\r\n
    Action.c(107):     Cookie: ASPSESSIONIDCQTCSCCT=IGICDMEBBCLGKLHEAIOBCIEA\r\n
    Action.c(107):     \r\n
    Action.c(85): t=4069ms: 443-byte response headers for "http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=7)   [issued at Action.c(107)]
    Action.c(107):     HTTP/1.1 302 Object moved\r\n
    Action.c(107):     Server: sdo\r\n
    Action.c(107):     Date: Sat, 13 Jun 2009 04:43:05 GMT\r\n
    Action.c(107):     Content-Type: text/html\r\n
    Action.c(107):     Connection: keep-alive\r\n
    Action.c(107):     Via: www1\r\n
    Action.c(107):     Pragma: No-Cache\r\n
    Action.c(107):     Location: http://lt.cas.sdo.com:8171/cas/l ... om/IndexIframeLogin
    Action.c(107):     .asp\r\n
    Action.c(107):     Content-Length: 205\r\n
    Action.c(107):     Expires: Fri, 12 Jun 2009 04:43:06 GMT\r\n
    Action.c(107):     Set-Cookie: refererURL=http%253A%2F%2Fwww%2Esdo%2Ecom%2FIndexIframeLogin%2Easp; domain=sdo
    Action.c(107):     .com; path=/\r\n
    Action.c(107):     Cache-control: no-cache\r\n
    Action.c(107):     \r\n
    Action.c(85): t=4100ms: 205-byte response body for "http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=7)   [issued at Action.c(107)]
    Action.c(107):     <head><title>Object moved</title></head>\n
    Action.c(107):     <body><h1>Object Moved</h1>This object may be found <a HREF="http://lt.cas.sdo.com:8171/ca
    Action.c(107):     s/login?service=http://www.sdo.com/IndexIframeLogin.asp">here</a>.</body>\n
    Action.c(85): Redirecting "http://www.sdo.com/IndexIframeLogin.asp" (redirection depth is 0)   [issued at Action.c(107)]          [MsgId: MMSG-26694]
    Action.c(85): To location "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp"   [issued at Action.c(107)]          [MsgId: MMSG-26693]
    Action.c(107): t=4115ms: Request done "http://www.sdo.com/IndexIframeLogin.asp"          [MsgId: MMSG-26000]
    Action.c(107): t=4123ms: Connecting to host 61.172.252.176:8171          [MsgId: MMSG-26000]
    Action.c(107): t=4140ms: Connected socket from 222.73.62.164:5884 to 61.172.252.176:8171 in 2 ms          [MsgId: MMSG-26000]
    Action.c(85): t=4143ms: 460-byte request headers for "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=8)   [issued at Action.c(107)]
    Action.c(107):     GET /cas/login?service=http://www.sdo.com/IndexIframeLogin.asp HTTP/1.1\r\n
    Action.c(107):     Referer: http://www.sdo.com/\r\n
    Action.c(107):     Accept-Language: zh-cn\r\n
    Action.c(107):     User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatibl
    Action.c(107):     e; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; InfoPath.2)\r\n
    Action.c(107):     Accept-Encoding: gzip, deflate\r\n
    Action.c(107):     Accept: */*\r\n
    Action.c(107):     Connection: Keep-Alive\r\n
    Action.c(107):     Host: lt.cas.sdo.com:8171\r\n
    Action.c(107):     Cookie: refererURL=http%253A%2F%2Fwww%2Esdo%2Ecom%2FIndexIframeLogin%2Easp\r\n
    Action.c(107):     \r\n
    Action.c(85): t=4205ms: 461-byte response headers for "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=8)   [issued at Action.c(107)]
    Action.c(107):     HTTP/1.1 200 OK\r\n
    Action.c(107):     Date: Sat, 13 Jun 2009 04:43:06 GMT\r\n
    Action.c(107):     Server: Microsoft-IIS/6.0\r\n
    Action.c(107):     X-Powered-By: ASP.NET\r\n
    Action.c(107):     P3P: CP=CAO PSA OUR\r\n
    Action.c(107):     Cache-Control: no-cache\r\n
    Action.c(107):     Via: Gauss\r\n
    Action.c(107):     X-AspNet-Version: 2.0.50727\r\n
    Action.c(107):     Set-Cookie: CAS_LOGIN_STATE=0; domain=sdo.com; expires=Fri, 12-Jun-2009 04:43:06 GMT; path
    Action.c(107):     =/\r\n
    Action.c(107):     Set-Cookie: SDO_SDID=0; domain=sdo.com; expires=Fri, 12-Jun-2009 04:43:06 GMT; path=/\r\n
    Action.c(107):     Cache-Control: private\r\n
    Action.c(107):     Content-Type: text/html; charset=gb2312\r\n
    Action.c(107):     Content-Length: 1460\r\n
    Action.c(107):     \r\n
    Action.c(85): t=4245ms: 999-byte response body for "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=8)   [issued at Action.c(107)]
    Action.c(107):     \r\n
    Action.c(107):     \r\n
    Action.c(107):     <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >\r\n
    Action.c(107):     <HTML>\r\n
    Action.c(107):     \t<HEAD>\r\n
    Action.c(107):     \t\t<title>Login</title>\r\n
    Action.c(107):     \t\t<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">\r\n
    Action.c(107):     \t\t<meta name="CODE_LANGUAGE" Content="C#">\r\n
    Action.c(107):     \t\t<meta name="vs_defaultClientScript" content="JavaScript">\r\n
    Action.c(107):     \t\t<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">\r
    Action.c(107):     \n
    Action.c(107):     \t\t\r\n
    Action.c(107):     \t\t\r\n
    Action.c(107):     \t\t\r\n
    Action.c(107):     \t\t<script language="javascript">\r\n
    Action.c(107):     \t\t\tfunction Rdirect()\r\n
    Action.c(107):     \t\t\t{\r\n
    Action.c(107):     \t\t\t    var path    =   "http://www.sdo.com/login2.asp?lt=Gauss-1ce80662-fa66-4cf6-9c97-
    Action.c(107):     a6bc018d3264-2009-06-13_12%3a43%3a06.009&service=http%3a%2f%2fwww.sdo.com%2fIndexIframeLog
    Action.c(107):     in.asp%3fcas%3d1";\r\n
    Action.c(107):     \t\t\t    if (0 < path.length)\r\n
    Action.c(107):     \t\t\t        location.href = path;\r\n
    Action.c(107):     \t\t\t    else\r\n
    Action.c(107):     \t\t\t        location.href = "http://www.sdo.com/login2.asp?lt=Gauss-749abb60-6616-4f3d-a
    Action.c(107):     006-13ee532c6ab4-2009-06-13_12:43:06.009&error=8|无效的Url";\r\n
    Action.c(107):     \t\t\t        \r\n
    Action.c(107):     \t\t\t\t//location.replace("http://www.sdo.com/login2.asp?lt=Gauss-1ce80662-fa66-4cf6-9c97
    Action.c(107):     -a6bc018d3264-2009-06-13_12%3
    Action.c(107): Notify: Saving Parameter "lt1 = Gauss-1ce80662-fa66-4cf6-9c97-a6bc018d3264-2009-06-13_12"
    Action.c(107): Notify: Saving Parameter "lt2 = 43"
    Action.c(107): Notify: Saving Parameter "lt3 = 06.009"
    Action.c(85): t=4296ms: 461-byte response body for "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp" (RelFrameId=1, Internal ID=8)   [issued at Action.c(107)]
    Action.c(107):     a43%3a06.009&service=http%3a%2f%2fwww.sdo.com%2fIndexIframeLogin.asp%3fcas%3d1");\r\n
    Action.c(107):     \t\t\t}\r\n
    Action.c(107):     \t\t</script>\r\n
    Action.c(107):     \t\t\r\n
    Action.c(107):     \t</HEAD>\r\n
    Action.c(107):     \t<body MS_POSITIONING="GridLayout" onload="Rdirect()";>\r\n
    Action.c(107):     \t\t<form name="Form1" method="post" action="login.aspx?service=http%3a%2f%2fwww.sdo.com%2
    Action.c(107):     fIndexIframeLogin.asp" id="Form1">\r\n
    Action.c(107):     <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTk3MjI4NTA5MmRkjp
    Action.c(107):     /FGCefEtp5ngvCD+XSmGBxJOI=" />\r\n
    Action.c(107):     \r\n
    Action.c(107):     \t\t\t\r\n
    Action.c(107):     \t\t\t\r\n
    Action.c(107):     \t\t</form>\r\n
    Action.c(107):     \t</body>\r\n
    Action.c(107):     </HTML>\r\n
    Action.c(107): t=4326ms: Request done "http://lt.cas.sdo.com:8171/cas/login?service=http://www.sdo.com/IndexIframeLogin.asp"          [MsgId: MMSG-26000]
    Action.c(107): web_concurrent_end was successful, 5827 body bytes, 2152 header bytes, 12 chunking overhead bytes          [MsgId: MMSG-26385]
    Action.c(110): web_concurrent_start started          [MsgId: MMSG-26355]
    Action.c(110): web_concurrent_start was successful          [MsgId: MMSG-26392]
    Action.c(111): web_url("ibw_tool.js") started          [MsgId: MMSG-26355]
    Action.c(111): Registering web_url("ibw_tool.js") was successful          [MsgId: MMSG-26390]
    Action.c(119): web_url("ibw_public.js") started          [MsgId: MMSG-26355]
    Action.c(119): Registering web_url("ibw_public.js") was successful          [MsgId: MMSG-26390]
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    12#
    发表于 2009-6-14 18:04:16 | 只看该作者
    没心情看你写了什么,试试看将search in 设置为ALL应该就可以了
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    13#
    发表于 2009-6-14 21:29:38 | 只看该作者
    我也录制了一下 SDO 登录, 产生了大量的 COOKIES 晕了..
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-11-28 06:51 , Processed in 0.071975 second(s), 28 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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