问几个用winsocket协议录制C/S程序的登录的问题
下面是我用winsocket协议录制C/S程序的登录的脚本,没改动,想问几个问题:
1.为什么在这个代码中没有我的登录信息,如果我想对这个登录信息做参数化怎么做
2.为什么后面会有那么多的"创建,发送,接收,禁用,关闭" 这正常吗
3.为何回放时会出错在下面这个位置
4.那针对这个脚本我需要怎样关联呢,以前没用过关联
lrs_receive("socket0", "buf105", LrsLastArg);
日志:
----
Action.c(454): Mismatch (expected 129 bytes, 0 bytes actually received)
Action.c(456): lrs_receive(socket0, buf105)
Action.c(456): 错误: socket0 - 软件造成连接终止。错误代码: 10053。
从操作调用了中止。
正在结束 Vuser...
正在开始操作 vuser_end。
vuser_end.c(12): lrs_cleanup()
正在结束操作 vuser_end。
Vuser 已终止。
------
[ 本帖最后由 test7 于 2008-4-23 09:43 编辑 ] #include "lrs.h"
Action()
{
lrs_create_socket("socket0", "TCP", "RemoteHost=**.**.**.97:80",LrsLastArg);
lrs_create_socket("socket1", "TCP", "RemoteHost=**.**.**.97:80",LrsLastArg);
lrs_create_socket("socket2", "TCP", "RemoteHost=**.**.**.97:80",LrsLastArg);
lrs_create_socket("socket3", "TCP", "RemoteHost=**.**.**.97:80",LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_send("socket1", "buf1", LrsLastArg);
lrs_send("socket2", "buf2", LrsLastArg);
lrs_send("socket3", "buf3", LrsLastArg);
lrs_receive("socket0", "buf4", LrsLastArg);
lrs_receive("socket1", "buf5", LrsLastArg);
lrs_receive("socket3", "buf6", LrsLastArg);
lrs_receive("socket2", "buf7", LrsLastArg);
lrs_create_socket("socket4", "TCP", "LocalHost=7000", "Backlog=2147483647",LrsLastArg);
lrs_close_socket("socket4");
lrs_create_socket("socket5", "UDP", "LocalHost=0",LrsLastArg);
lrs_send("socket5", "buf8", "TargetSocket=**.**.**.250:1900", LrsLastArg);
lrs_receive("socket5", "buf9", LrsLastArg);
lrs_create_socket("socket6", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket6", "buf10", LrsLastArg);
lrs_receive("socket6", "buf11", LrsLastArg);
lrs_close_socket("socket6");
lrs_create_socket("socket7", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket7", "buf12", LrsLastArg);
lrs_disable_socket("socket7", DISABLE_SEND);
lrs_send("socket0", "buf13", LrsLastArg);
lrs_send("socket1", "buf14", LrsLastArg);
lrs_send("socket3", "buf15", LrsLastArg);
lrs_send("socket2", "buf16", LrsLastArg);
lrs_receive("socket7", "buf17", LrsLastArg);
lrs_close_socket("socket7");
lrs_create_socket("socket8", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket8", "buf18", LrsLastArg);
lrs_disable_socket("socket8", DISABLE_SEND);
lrs_receive("socket8", "buf19", LrsLastArg);
lrs_close_socket("socket8");
lrs_create_socket("socket9", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket9", "buf20", LrsLastArg);
lrs_disable_socket("socket9", DISABLE_SEND);
lrs_receive("socket9", "buf21", LrsLastArg);
lrs_receive("socket0", "buf22", LrsLastArg);
lrs_close_socket("socket9");
lrs_create_socket("socket10", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_receive("socket2", "buf23", LrsLastArg);
lrs_send("socket10", "buf24", LrsLastArg);
lrs_receive("socket2", "buf25", LrsLastArg);
lrs_disable_socket("socket10", DISABLE_SEND);
lrs_receive("socket2", "buf26", LrsLastArg);
lrs_receive("socket10", "buf27", LrsLastArg);
lrs_close_socket("socket10");
lrs_receive("socket1", "buf28", LrsLastArg);
lrs_receive("socket1", "buf29", LrsLastArg);
lrs_create_socket("socket11", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_receive("socket1", "buf30", LrsLastArg);
lrs_send("socket11", "buf31", LrsLastArg);
lrs_disable_socket("socket11", DISABLE_SEND);
lrs_receive("socket3", "buf32", LrsLastArg);
lrs_receive("socket11", "buf33", LrsLastArg);
lrs_close_socket("socket11");
lrs_create_socket("socket12", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket12", "buf34", LrsLastArg);
lrs_disable_socket("socket12", DISABLE_SEND);
lrs_receive("socket12", "buf35", LrsLastArg);
lrs_close_socket("socket12");
lrs_create_socket("socket13", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket13", "buf36", LrsLastArg);
lrs_receive("socket1", "buf37", LrsLastArg);
lrs_disable_socket("socket13", DISABLE_SEND);
lrs_receive("socket13", "buf38", LrsLastArg);
lrs_receive("socket3", "buf39", LrsLastArg);
lrs_receive("socket13", "buf40", LrsLastArg);
lrs_close_socket("socket13");
lrs_receive("socket2", "buf41", LrsLastArg);
lrs_create_socket("socket14", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket14", "buf42", LrsLastArg);
lrs_disable_socket("socket14", DISABLE_SEND);
lrs_receive("socket14", "buf43", LrsLastArg);
lrs_close_socket("socket14");
lrs_create_socket("socket15", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket15", "buf44", LrsLastArg);
lrs_disable_socket("socket15", DISABLE_SEND); lrs_receive("socket15", "buf45", LrsLastArg);
lrs_close_socket("socket15");
lrs_create_socket("socket16", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket16", "buf46", LrsLastArg);
lrs_disable_socket("socket16", DISABLE_SEND);
lrs_receive("socket16", "buf47", LrsLastArg);
lrs_close_socket("socket16");
lrs_create_socket("socket17", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket17", "buf48", LrsLastArg);
lrs_disable_socket("socket17", DISABLE_SEND);
lrs_receive("socket17", "buf49", LrsLastArg);
lrs_close_socket("socket17");
lrs_create_socket("socket18", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket18", "buf50", LrsLastArg);
lrs_disable_socket("socket18", DISABLE_SEND);
lrs_receive("socket18", "buf51", LrsLastArg);
lrs_close_socket("socket18");
lrs_create_socket("socket19", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket19", "buf52", LrsLastArg);
lrs_disable_socket("socket19", DISABLE_SEND);
lrs_receive("socket19", "buf53", LrsLastArg);
lrs_close_socket("socket19");
lrs_create_socket("socket20", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket20", "buf54", LrsLastArg);
lrs_disable_socket("socket20", DISABLE_SEND);
lrs_receive("socket20", "buf55", LrsLastArg);
lrs_close_socket("socket20");
lrs_create_socket("socket21", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket21", "buf56", LrsLastArg);
lrs_disable_socket("socket21", DISABLE_SEND);
lrs_receive("socket21", "buf57", LrsLastArg);
lrs_close_socket("socket21");
lrs_create_socket("socket22", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket22", "buf58", LrsLastArg);
lrs_disable_socket("socket22", DISABLE_SEND);
lrs_receive("socket22", "buf59", LrsLastArg);
lrs_close_socket("socket22");
lrs_create_socket("socket23", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket23", "buf60", LrsLastArg);
lrs_disable_socket("socket23", DISABLE_SEND);
lrs_receive("socket23", "buf61", LrsLastArg);
lrs_close_socket("socket23");
lrs_create_socket("socket24", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket24", "buf62", LrsLastArg);
lrs_disable_socket("socket24", DISABLE_SEND);
lrs_receive("socket24", "buf63", LrsLastArg);
lrs_close_socket("socket24");
lrs_create_socket("socket25", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket25", "buf64", LrsLastArg);
lrs_disable_socket("socket25", DISABLE_SEND);
lrs_receive("socket25", "buf65", LrsLastArg);
lrs_close_socket("socket25");
lrs_create_socket("socket26", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket26", "buf66", LrsLastArg);
lrs_disable_socket("socket26", DISABLE_SEND);
lrs_receive("socket26", "buf67", LrsLastArg);
lrs_close_socket("socket26");
lrs_create_socket("socket27", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket27", "buf68", LrsLastArg);
lrs_disable_socket("socket27", DISABLE_SEND);
lrs_receive("socket27", "buf69", LrsLastArg);
lrs_close_socket("socket27");
lrs_create_socket("socket28", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket28", "buf70", LrsLastArg);
lrs_disable_socket("socket28", DISABLE_SEND);
lrs_receive("socket28", "buf71", LrsLastArg);
lrs_close_socket("socket28");
lrs_create_socket("socket29", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket29", "buf72", LrsLastArg);
lrs_disable_socket("socket29", DISABLE_SEND);
lrs_receive("socket29", "buf73", LrsLastArg);
lrs_close_socket("socket29");
lrs_create_socket("socket30", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket30", "buf74", LrsLastArg);
lrs_disable_socket("socket30", DISABLE_SEND);
lrs_receive("socket30", "buf75", LrsLastArg);
lrs_close_socket("socket30");
lrs_create_socket("socket31", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket31", "buf76", LrsLastArg);
lrs_disable_socket("socket31", DISABLE_SEND);
lrs_receive("socket31", "buf77", LrsLastArg);
lrs_close_socket("socket31");
lrs_create_socket("socket32", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket32", "buf78", LrsLastArg);
lrs_disable_socket("socket32", DISABLE_SEND);
lrs_receive("socket32", "buf79", LrsLastArg);
lrs_close_socket("socket32");
lrs_create_socket("socket33", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket33", "buf80", LrsLastArg);
lrs_disable_socket("socket33", DISABLE_SEND);
lrs_receive("socket33", "buf81", LrsLastArg);
lrs_close_socket("socket33");
lrs_create_socket("socket34", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket34", "buf82", LrsLastArg); lrs_disable_socket("socket34", DISABLE_SEND);
lrs_receive("socket34", "buf83", LrsLastArg);
lrs_close_socket("socket34");
lrs_create_socket("socket35", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket35", "buf84", LrsLastArg);
lrs_disable_socket("socket35", DISABLE_SEND);
lrs_receive("socket35", "buf85", LrsLastArg);
lrs_close_socket("socket35");
lrs_create_socket("socket36", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket36", "buf86", LrsLastArg);
lrs_disable_socket("socket36", DISABLE_SEND);
lrs_receive("socket36", "buf87", LrsLastArg);
lrs_close_socket("socket36");
lrs_create_socket("socket37", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket37", "buf88", LrsLastArg);
lrs_disable_socket("socket37", DISABLE_SEND);
lrs_receive("socket37", "buf89", LrsLastArg);
lrs_close_socket("socket37");
lrs_create_socket("socket38", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket38", "buf90", LrsLastArg);
lrs_disable_socket("socket38", DISABLE_SEND);
lrs_receive("socket38", "buf91", LrsLastArg);
lrs_close_socket("socket38");
lrs_create_socket("socket39", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket39", "buf92", LrsLastArg);
lrs_disable_socket("socket39", DISABLE_SEND);
lrs_receive("socket39", "buf93", LrsLastArg);
lrs_close_socket("socket39");
lrs_create_socket("socket40", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket40", "buf94", LrsLastArg);
lrs_disable_socket("socket40", DISABLE_SEND);
lrs_send("socket0", "buf95", LrsLastArg);
lrs_receive("socket40", "buf96", LrsLastArg);
lrs_send("socket1", "buf97", LrsLastArg);
lrs_close_socket("socket40");
lrs_create_socket("socket41", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket3", "buf98", LrsLastArg);
lrs_send("socket41", "buf99", LrsLastArg);
lrs_disable_socket("socket41", DISABLE_SEND);
lrs_send("socket2", "buf100", LrsLastArg);
lrs_receive("socket41", "buf101", LrsLastArg);
lrs_close_socket("socket41");
lrs_create_socket("socket42", "TCP", "RemoteHost=buffalo.setup:49152",LrsLastArg);
lrs_send("socket42", "buf102", LrsLastArg);
lrs_disable_socket("socket42", DISABLE_SEND);
lrs_receive("socket42", "buf103", LrsLastArg);
lrs_close_socket("socket42");
lrs_receive("socket1", "buf104", LrsLastArg);
lrs_receive("socket0", "buf105", LrsLastArg);
lrs_receive("socket3", "buf106", LrsLastArg);
lrs_receive("socket2", "buf107", LrsLastArg);
lr_think_time(13);
lrs_send("socket1", "buf108", LrsLastArg);
lrs_receive("socket1", "buf109", LrsLastArg);
lrs_create_socket("socket43", "UDP", "LocalHost=7000",LrsLastArg);
lrs_send("socket43", "buf110", "TargetSocket=**.**.**.97:5555", LrsLastArg);
lrs_send("socket0", "buf111", LrsLastArg);
lrs_receive("socket43", "buf112", LrsLastArg);
lrs_receive("socket0", "buf113", LrsLastArg);
lrs_send("socket43", "buf114", "TargetSocket=**.**.**.97:5555", LrsLastArg);
lrs_receive("socket43", "buf115", LrsLastArg);
lrs_send("socket43", "buf116", "TargetSocket=**.**.**.97:5555", LrsLastArg);
lrs_receive("socket43", "buf117", LrsLastArg);
lrs_send("socket43", "buf118", "TargetSocket=**.**.**.98:5555", LrsLastArg);
lrs_receive("socket43", "buf119", LrsLastArg);
lrs_send("socket43", "buf120", "TargetSocket=**.**.**.98:5555", LrsLastArg);
lrs_receive("socket43", "buf121", LrsLastArg);
lrs_send("socket43", "buf122", "TargetSocket=**.**.**.98:5555", LrsLastArg);
lrs_receive("socket43", "buf123", LrsLastArg);
lrs_send("socket43", "buf124", "TargetSocket=**.**.**.97:1512", LrsLastArg);
lrs_receive("socket43", "buf125", LrsLastArg);
lrs_create_socket("socket44", "TCP", "LocalHost=7000", "Backlog=2147483647",LrsLastArg);
lrs_send("socket43", "buf126", "TargetSocket=**.**.**.97:1512", LrsLastArg);
return 0;
} 你在录脚本的时候加点注释,就知道那快是登陆的操作了
具体登陆数据去Data.ws里看,参数化在这里做,找到你的录制时候输入的用户名,密码等信息 原帖由 cclover 于 2008-4-17 16:26 发表 http://bbs.51testing.com/images/common/back.gif
你在录脚本的时候加点注释,就知道那快是登陆的操作了
具体登陆数据去Data.ws里看,参数化在这里做,找到你的录制时候输入的用户名,密码等信息
多谢,参数化也是在这个data.ws里做是吧 剩下那两个问题谁能帮我看看 顶一下 再顶 Action.c(454): Mismatch (expected 129 bytes, 0 bytes actually received)
大部分情况是因为没有做关联,实际上,lr脚本录完了回放不了最主要的一个原因就是关联没做好 那针对这个脚本我需要怎样关联呢,以前没用过关联 学习中 学习中
页:
[1]