51Testing软件测试论坛
标题:
cs系统上传文件的脚本录制
[打印本页]
作者:
zhoward
时间:
2010-6-4 11:04
标题:
cs系统上传文件的脚本录制
系统通过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软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2