51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 4711|回复: 15
打印 上一主题 下一主题

[求助] 用sock录制,data.ws中的数据怎么做关联?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2006-6-2 21:13:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
用sock录制,data.ws中的数据怎么做关联?
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2006-6-3 15:06:49 | 只看该作者
ding
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2006-6-3 19:39:27 | 只看该作者
找到数据关系就是了。步骤一样的
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2006-6-5 10:15:33 | 只看该作者
那么那些函数(web_reg_save_param.......)写在哪里?

action里面还是 data.ws里面???

谢谢
回复 支持 反对

使用道具 举报

该用户从未签到

5#
发表于 2006-6-5 10:17:16 | 只看该作者
当然是action中。
回复 支持 反对

使用道具 举报

该用户从未签到

6#
发表于 2006-6-5 10:50:14 | 只看该作者
不能用web_reg_save_param函数,socks脚本有自己的函数
回复 支持 反对

使用道具 举报

该用户从未签到

7#
 楼主| 发表于 2006-6-5 11:15:17 | 只看该作者
data.ws中我要换的是    282888a80b7048b0010b70e1b44b0014

send  buf137 289
        "<body rid='765740' sid='282888a80b7048b0010b70e1b44b0014' xmlns='http://ja"
        "bber.org/protocol/httpbind' key='1541120fac8eec02e7e525f03c816280aebdab43'"
        " ><iq type=\"get\" id=\"auth1\"><query xmlns=\"jabber:iq:auth\"><username>"
        "~200127.03.eb15accc6fc720060602172941176</username></query></iq>\r\n"
        "</body>"


Action中是这段

    lrs_send("socket1", "buf137", LrsLastArg);
-----------------------------------------------------------------------

谢谢拉

到底要用什么函数?写在Action的哪里啊?
回复 支持 反对

使用道具 举报

该用户从未签到

8#
发表于 2006-6-5 11:56:11 | 只看该作者
看看一个例子。

For example, lets say you have to capture the PID from the following receive buffer (This is
an example from LR function reference):
"\r"
"\x0 blah blah blah "
"\r\n blah blah blah "
"PID TT STAT TIME COMMAND\r\n PID 28469 q2"
" S 0:01 -tcsh (tcsh)\r\n"
……
In a typical web script, you would use a web_create_html_param and use “PID “ and “ q2” as
the boundaries to capture the data.
In a Winsock script, you would use lrs_save_param that saves data from a static or received
buffer to a parameter. See the example below:
lrs_receive("socket2", "buf47", LrsLastArg);
lrs_save_param("socket2", NULL, "param1", 67, 5);
Unlike web_create_html_param, lrs_save_param goes after the request is made. In
this example, the first statement is receiving buf47. The following are the arguments
used in the lrs_save_param statement:
socket2: Capture from a buffer on socket2
NULL: NULL indicates that the parameter should be captured from the last received buffer. In
this case it is buf47. If you were to capture from any other buffer, you will have to specify the
buffer number.
param1: Name of the LR parameter in which to staore the captured value
67: Offset – explained below.
5: length of the to be captured
Offset: This is the number of bytes from the beginning of the buffer to start capturing. In the
above example, the PID starts after 67 bytes from the beginning of buf47. How do you
determine this?
Highlight the whole buffer in data.ws that contains the parameter to be captured and hit F7.
This will bring up a window as shown below:
In the left column, you will see the offset that corresponds to that line. In the middle 4
columns, you see the EBCDIC translation of the buffer. And in the right column, you have the
actual buffer itself. So if you look at the fifth line in the actual buffer, that is where you PID
lies. But we want to start capturing after the third location in that line. The offset for that
entire line is 64, and the offset for the PID within that line is 3, which makes the offset 67.
(Now does that explain why I had to add all those blah blah blahs in the buffer to make it
match my example? J)
回复 支持 反对

使用道具 举报

该用户从未签到

9#
 楼主| 发表于 2006-6-5 13:09:14 | 只看该作者
我的receive buffer 里面没有这个sessionid(282888a80b7048b0010b70e1b44b0014
)字符串
回复 支持 反对

使用道具 举报

该用户从未签到

10#
发表于 2006-6-5 13:12:59 | 只看该作者
原帖由 andrew_zx 于 2006-6-5 13:09 发表
我的receive buffer 里面没有这个sessionid(282888a80b7048b0010b70e1b44b0014
)字符串

我说了是个例子,你不能照搬嘛,你要看你自己的里面的相应的变量。
回复 支持 反对

使用道具 举报

该用户从未签到

11#
 楼主| 发表于 2006-6-5 13:25:06 | 只看该作者
现在重点是,我不知道sessionid从哪里取的,再放到send的那些函数里,现在录制下来的data.ws里只有send数据包里有sessionid
回复 支持 反对

使用道具 举报

该用户从未签到

12#
 楼主| 发表于 2006-6-5 17:21:52 | 只看该作者
大家帮帮忙啊

谢谢了
回复 支持 反对

使用道具 举报

该用户从未签到

13#
 楼主| 发表于 2006-6-6 09:35:34 | 只看该作者
help
回复 支持 反对

使用道具 举报

该用户从未签到

14#
发表于 2006-6-6 13:52:29 | 只看该作者
你都不知道那个session是从哪儿来的,别人怎么会知道?
除非这儿有人是上帝。
回复 支持 反对

使用道具 举报

该用户从未签到

15#
发表于 2006-6-7 16:34:07 | 只看该作者
手工关联
手工添加函数,把最后收到的buffer保存到字符串数组,然后取出你要的,然后指定要发出的buffer。
回复 支持 反对

使用道具 举报

该用户从未签到

16#
发表于 2012-6-10 16:35:19 | 只看该作者
关注中……
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-9-28 06:22 , Processed in 0.182361 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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