51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1212|回复: 3
打印 上一主题 下一主题

[原创] 各位达人来帮下忙

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2009-12-8 17:56:26 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Action()
{

        lr_think_time(6);

        lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=10.0.64.52:40000", LrsLastArg);

        lrs_send("socket0", "buf0", LrsLastArg);

        lrs_receive("socket0", "buf1", LrsLastArg);

        lrs_send("socket0", "buf2", LrsLastArg);


lrs_save_param("socket0", "buf2", "param1", 16, 5);
lr_output_message ("param1: %s", "<param1>");


        lrs_close_socket("socket0");

        lrs_create_socket("socket1", "TCP", "LocalHost=0", "RemoteHost=10.0.64.111:54007", LrsLastArg);

        lrs_send("socket1", "buf3", LrsLastArg);

        lrs_receive("socket1", "buf4", LrsLastArg);

        lrs_send("socket1", "buf5", LrsLastArg);

        lrs_receive("socket1", "buf6", LrsLastArg);

        lrs_send("socket1", "buf7", LrsLastArg);

        lrs_receive("socket1", "buf8", LrsLastArg);

        lrs_send("socket1", "buf9", LrsLastArg);

        lrs_receive("socket1", "buf10", LrsLastArg);

        lrs_send("socket1", "buf11", LrsLastArg);

        lrs_receive("socket1", "buf12", LrsLastArg);

        lrs_send("socket1", "buf13", LrsLastArg);

        lrs_receive("socket1", "buf14", LrsLastArg);

        lrs_send("socket1", "buf15", LrsLastArg);

        lrs_receive("socket1", "buf16", LrsLastArg);

        lrs_send("socket1", "buf17", LrsLastArg);

        lrs_receive("socket1", "buf18", LrsLastArg);

        lrs_send("socket1", "buf19", LrsLastArg);

        lrs_receive("socket1", "buf20", LrsLastArg);
   

        lrs_create_socket("socket2", "TCP", "LocalHost=0", "RemoteHost=S-3-RD-NIC-001:21", LrsLastArg);

        lrs_receive("socket2", "buf21", LrsLastArg);

        lrs_send("socket2", "buf22", LrsLastArg);

        lrs_receive("socket2", "buf23", LrsLastArg);

        lrs_send("socket2", "buf24", LrsLastArg);

        lrs_receive("socket2", "buf25", LrsLastArg);

        lrs_send("socket2", "buf26", LrsLastArg);

        lrs_receive("socket2", "buf27", LrsLastArg);

        lrs_send("socket2", "buf28", LrsLastArg);

        lrs_receive("socket2", "buf29", LrsLastArg);

        lrs_send("socket2", "buf30", LrsLastArg);

        lrs_receive("socket2", "buf31", LrsLastArg);

        lrs_send("socket2", "buf32", LrsLastArg);

        lrs_receive("socket2", "buf33", LrsLastArg);

        lrs_create_socket("socket3", "TCP", "LocalHost=0", "RemoteHost=S-3-RD-NIC-001:2449", LrsLastArg);

        lrs_send("socket2", "buf34", LrsLastArg);

        lrs_receive("socket2", "buf35", LrsLastArg);

        lrs_receive("socket3", "buf36", LrsLastArg);

        lrs_close_socket("socket3");

        lrs_receive("socket2", "buf37", LrsLastArg);

        lrs_send("socket2", "buf38", LrsLastArg);

        lrs_receive("socket2", "buf39", LrsLastArg);

        lrs_send("socket2", "buf40", LrsLastArg);

        lrs_receive("socket2", "buf41", LrsLastArg);

        lrs_send("socket2", "buf42", LrsLastArg);

        lrs_receive("socket2", "buf43", LrsLastArg);

        lrs_create_socket("socket4", "TCP", "LocalHost=0", "RemoteHost=S-3-RD-NIC-001:2450", LrsLastArg);

        lrs_send("socket2", "buf44", LrsLastArg);

        lrs_receive("socket2", "buf45", LrsLastArg);

        lrs_receive("socket4", "buf46", LrsLastArg);

        lrs_receive("socket2", "buf47", LrsLastArg);

        lrs_receive("socket4", "buf48", LrsLastArg);

        lrs_close_socket("socket4");

        lr_think_time(4);

        lrs_send("socket2", "buf49", LrsLastArg);

        lrs_receive("socket2", "buf50", LrsLastArg);

        lrs_send("socket2", "buf51", LrsLastArg);

        lrs_receive("socket2", "buf52", LrsLastArg);

        lrs_send("socket2", "buf53", LrsLastArg);

        lrs_receive("socket2", "buf54", LrsLastArg);

        lrs_create_socket("socket5", "TCP", "LocalHost=0", "RemoteHost=S-3-RD-NIC-001:2451", LrsLastArg);

        lrs_send("socket2", "buf55", LrsLastArg);

        lrs_receive("socket2", "buf56", LrsLastArg);

        lrs_receive("socket5", "buf57", LrsLastArg);

        lrs_receive("socket2", "buf58", LrsLastArg);

        lrs_receive("socket5", "buf59", LrsLastArg);

        lrs_close_socket("socket5");

        lr_think_time(6);

        lrs_send("socket2", "buf60", LrsLastArg);

        lrs_receive("socket2", "buf61", LrsLastArg);

        lrs_close_socket("socket2");

        lrs_send("socket1", "buf62", LrsLastArg);

        lrs_receive("socket1", "buf63", LrsLastArg);

        lrs_send("socket1", "buf64", LrsLastArg);

        lrs_receive("socket1", "buf65", LrsLastArg);

        lrs_send("socket1", "buf66", LrsLastArg);

        lrs_receive("socket1", "buf67", LrsLastArg);

        lrs_send("socket1", "buf68", LrsLastArg);

        lrs_receive("socket1", "buf69", LrsLastArg);

        lrs_send("socket1", "buf70", LrsLastArg);

        lrs_receive("socket1", "buf71", LrsLastArg);

        lrs_send("socket1", "buf72", LrsLastArg);

        lrs_receive("socket1", "buf73", LrsLastArg);

        lrs_send("socket1", "buf74", LrsLastArg);

        lrs_receive("socket1", "buf75", LrsLastArg);

        lrs_send("socket1", "buf76", LrsLastArg);

        lrs_receive("socket1", "buf77", LrsLastArg);

        lrs_send("socket1", "buf78", LrsLastArg);

        lrs_receive("socket1", "buf79", LrsLastArg);

        lrs_send("socket1", "buf80", LrsLastArg);

        lrs_receive("socket1", "buf81", LrsLastArg);

        lrs_send("socket1", "buf82", LrsLastArg);

        lrs_receive("socket1", "buf83", LrsLastArg);

        lrs_send("socket1", "buf84", LrsLastArg);

        lrs_receive("socket1", "buf85", LrsLastArg);

        lrs_send("socket1", "buf86", LrsLastArg);

        lrs_receive("socket1", "buf87", LrsLastArg);

        lrs_send("socket1", "buf88", LrsLastArg);

        lrs_receive("socket1", "buf89", LrsLastArg);

        web_url("10.0.64.246_2",
                "URL=http://10.0.64.246/",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t3.inf",
                "Mode=HTML",
                LAST);

        lrs_send("socket1", "buf90", LrsLastArg);

        lrs_receive("socket1", "buf91", LrsLastArg);

        web_custom_request("10.0.64.246_3",
                "URL=http://10.0.64.246/",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t4.inf",
                "Mode=HTML",
                "Body=online=true&username=crr@中山市交通局",
                LAST);

        lrs_send("socket1", "buf92", LrsLastArg);

        lrs_receive("socket1", "buf93", LrsLastArg);

        lrs_send("socket1", "buf94", LrsLastArg);

        lrs_receive("socket1", "buf95", LrsLastArg);

        lrs_send("socket1", "buf96", LrsLastArg);

        lrs_receive("socket1", "buf97", LrsLastArg);

        return 0;
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2009-12-8 17:57:06 | 只看该作者
回放的时候都会出Action.c(60): Error : Host socket2 is unknown. Error code : 9008
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2009-12-8 17:58:54 | 只看该作者
是否是服务器IP改变了,导致这个问题?要如何用函数把变量写出来,再调用呢?
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2009-12-8 17:59:49 | 只看该作者
lrs_save_param("socket0", "buf2", "param1", 16, 5);
lr_output_message ("param1: %s", "<param1>");
我写了这个,可是老是回放不成功啊
回复 支持 反对

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-14 11:40 , Processed in 0.064396 second(s), 24 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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