51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1753|回复: 0
打印 上一主题 下一主题

[原创] cs系统上传文件的脚本录制

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-6-4 11:04:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
系统通过ftp上传文件,因此使用ftp协议进行录制,在上传前设置事务,但是录制后的脚本只有事务开始和结束标识,再没有其他脚本,感觉有问题。因此使用sockets来进行录制,回放时出现错误如下

Action.c(300) 9013 Error: Unable to translate buffer to socket12. Error code : 9013

上传文件的脚本如下:
lr_start_transaction("UploadADFile");

    lr_think_time(39);

    lrs_create_socket("socket11", "TCP", "RemoteHost=192.168.1.212:21",  LrsLastArg);

    lrs_receive("socket11", "buf80", LrsLastArg);

    lrs_send("socket11", "buf81", LrsLastArg);

    lrs_receive("socket11", "buf82", LrsLastArg);

    lrs_send("socket11", "buf83", LrsLastArg);

    lrs_receive("socket11", "buf84", LrsLastArg);

    lrs_send("socket11", "buf85", LrsLastArg);

    lrs_receive("socket11", "buf86", LrsLastArg);

    lrs_send("socket11", "buf87", LrsLastArg);

    lrs_receive("socket11", "buf88", LrsLastArg);

    lrs_send("socket11", "buf89", LrsLastArg);

    lrs_receive("socket11", "buf90", LrsLastArg);

    lrs_send("socket11", "buf91", LrsLastArg);

    lrs_receive("socket11", "buf92", LrsLastArg);

    lrs_send("socket11", "buf93", LrsLastArg);

    lrs_receive("socket11", "buf94", LrsLastArg);

    lrs_create_socket("socket12", "TCP", "RemoteHost=192.168.1.212:57817",  LrsLastArg);

    lrs_send("socket11", "buf95", LrsLastArg);

    lrs_receive("socket11", "buf96", LrsLastArg);

    lrs_send("socket12", "buf97", LrsLastArg);

    lrs_disable_socket("socket12", DISABLE_SEND_RECV);

    lrs_close_socket("socket12");

    lrs_receive("socket11", "buf98", LrsLastArg);

    lrs_create_socket("socket13", "UDP", "LocalHost=0",  LrsLastArg);

    lrs_send("socket13", "buf99", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket13", "buf100", LrsLastArg);

    lrs_send("socket13", "buf101", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket13", "buf102", LrsLastArg);

    lrs_send("socket13", "buf103", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket13", "buf104", LrsLastArg);

    lrs_send("socket13", "buf105", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket13", "buf106", LrsLastArg);

    lrs_send("socket13", "buf107", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket13", "buf108", LrsLastArg);

    lrs_send("socket13", "buf109", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket13", "buf110", LrsLastArg);

    lrs_close_socket("socket13");

    lrs_create_socket("socket14", "UDP", "LocalHost=0",  LrsLastArg);

    lrs_send("socket14", "buf111", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket14", "buf112", LrsLastArg);

    lrs_send("socket14", "buf113", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket14", "buf114", LrsLastArg);

    lrs_send("socket14", "buf115", "TargetSocket=192.168.1.212:40000", LrsLastArg);

    lrs_receive("socket14", "buf116", LrsLastArg);

    lrs_close_socket("socket14");

    lr_end_transaction("UploadADFile", LR_AUTO);


红色显示语句为出现错误的地方。 有高手说上传文件比较复杂,我想问一下,对于上传,乃至下载文件,到底需要怎么录制编写脚本??
ps:这里说的是c/s系统。

在此拜谢...

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?(注-册)加入51Testing

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

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-16 21:51 , Processed in 0.083391 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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