51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

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

[原创] 请教下云层,为何一直关联不到

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2013-5-26 09:32:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 素还真 于 2013-5-26 09:55 编辑

我安装了书上说的那个xampp,然后进行登录!

        lr_start_transaction("login");

        //lr_think_time(20);

        web_submit_data("login.php",
                "Action=http://127.0.0.1:7001/phpwind85/login.php",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://127.0.0.1:7001/phpwind85/index.php",
                "Snapshot=t2.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=jumpurl", "Value=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "Name=step", "Value=2", ENDITEM,
                "Name=pwuser", "Value=test1", ENDITEM,
                "Name=pwpwd", "Value=123456", ENDITEM,
                "Name=head_login", "Value=", ENDITEM,
                "Name=lgt", "Value=0", ENDITEM,
                EXTRARES,
                "URL=js/lang/zh_cn.js", ENDITEM,
                "URL=images/register/regright2.png", ENDITEM,
                "URL=images/wind85/bg.jpg", ENDITEM,
                "URL=images/down.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/topbar.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/navA.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/g/facebg_a.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/down.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/search_btn.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/searchA.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/colon.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/hB.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/old.gif", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/wind85/h.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/pwicon/top.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/job/doupdateavatar.gif", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/job/dosendmessage.gif", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/job/doaddfriend.gif", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                "URL=images/job/menu_tasksA.png", "Referer=http://127.0.0.1:7001/phpwind85/index.php", ENDITEM,
                LAST);


        web_url("pw_ajax.php",
                "URL=http://127.0.0.1:7001/phpwind85/pw_ajax.php?action=jobpop&nowtime=1369492471876&verify=68c4e992",
                "Resource=0",
                "RecContentType=text/xml",
                "Referer=http://127.0.0.1:7001/phpwind85/index.php",
                "Snapshot=t3.inf",
                "Mode=HTML",
                LAST);

        lr_end_transaction("login", LR_AUTO);

上面的nowtime是一个变动的数据
如何获取它的数值呢?

在tree下面看到的是:
HTTP/1.1 200 OK
Date: Sat, 25 May 2013 14:34:31 GMT
Server: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
X-Powered-By: PHP/5.4.7
Set-Cookie: f87b1_lastpos=other; expires=Sun, 25-May-2014 14:34:31 GMT; path=/
Set-Cookie: f87b1_lastvisit=2%091369492471%09%2Fphpwind85%2Fpw_ajax.php%3Factionjobpop%26nowtime1369492471876%26verify68c4e992; expires=Sun, 25-May-2014 14:34:31 GMT; path=/
Set-Cookie: f87b1_jobpop=0; expires=Sun, 25-May-2014 14:34:31 GMT; path=/
Content-Encoding: gzip
Content-Length: 1161
Keep-Alive: timeout=5, max=92
Connection: Keep-Alive
Content-Type: text/xml;charset=utf-8

<?xml version="1.0"


而我使用:(放在web_submit_data后面,web_url脚本前)

    web_reg_save_param_regexp(
                "ParamName=temp1",
                "RegExp=Set-Cookie: f87b1_lastvisit.*pw_ajax.php%3Factionjobpop%26nowtime(.*)%26verify.*",
                "Ordinal=1",
                SEARCH_FILTERS,
                LAST);

output后发现temp1等于那串数字!
但是如果我在代码中的那个nowtime={temp1}后,再输出temp1,结果就会等于%7Btemp1%7D
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2013-5-26 09:35:36 | 只看该作者
本帖最后由 素还真 于 2013-5-26 09:54 编辑

我通过输出,temp1=%7Btemp1%7D
很奇怪,为什么是%7B和%7D,中间又是temp1(也就是参数名

如果
web_url("pw_ajax.php",
  "URL=http://127.0.0.1:7001/phpwind85/pw_ajax.php?action=jobpop&nowtime={temp1}&verify=68c4e992"
这个不参数化,则输出的temp1结果是正确的,而如果使用了参数化后,temp1结果输出的就会%Btemp1%7D呢?
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2013-5-27 08:49:09 | 只看该作者
Nowtime的作用是个时间戳吧,应该不用处理的,
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2013-5-27 09:57:28 | 只看该作者
回复 3# 云层


其实我的疑问是,为什么我如果不参数化和参数化后,结果不同,特奇怪!
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2013-5-27 15:15:45 | 只看该作者
参数化?
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-5-3 19:03 , Processed in 0.069912 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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