|
诚请各位帮我分析一下问题:、
我要做并发测试,我在客户端利用LR选择winsocket协议对一个cs架构的程序录制了脚本(未添加集合点),录制的操作是先启动一个服务(事务1),然后进行查询(事务2),对查询的某一项进行下载(事务3),最后关闭服务(事务4)
经过我几天的奋斗脚本可以回放成功(在VuGen和Controller均可以),但是在多虚拟用户同时执行脚本时则出现了socket0-Address already in use:Error10048.发现在不同用户执行脚本时socket资源的使用存在冲突,服务端的状况是:制定数据传输端口,可为某IP主机某端口开启访问权限(可开多端口,但是登录名称要不同),可是我比较脚本后发现不同登录用户名进行同样的操作脚本有差异的(见图1,不同用户名TestLY1和 TestLY,用到的分别本地端口不同),这样导致参数化不知道怎样进行。各位高手指导一下吧,先拜谢了!!
不知道各位是怎么解决socket冲突以及上述情况参数化的问题的,我的脚本action如下:Action()
{
lr_start_transaction("1");
lrs_create_socket("socket0", "TCP", "LocalHost=8022", "Backlog=5", LrsLastArg);
lr_end_transaction("1", LR_AUTO);
lr_start_transaction("2");
lrs_create_socket("socket1", "TCP", "RemoteHost=VICO-8CB8683712:5678", LrsLastArg);
lrs_send("socket1", "buf0", LrsLastArg);
lrs_receive("socket1", "buf1", LrsLastArg);
lrs_send("socket1", "buf2", LrsLastArg);
lrs_receive("socket1", "buf3", LrsLastArg);
lrs_send("socket1", "buf4", LrsLastArg);
lrs_receive("socket1", "buf5", LrsLastArg);
lrs_close_socket("socket1");
lr_end_transaction("2", LR_AUTO);
lr_start_transaction("3");
lrs_create_socket("socket2", "TCP", "RemoteHost=VICO-8CB8683712:5678", LrsLastArg);
lrs_send("socket2", "buf6", LrsLastArg);
lrs_receive("socket2", "buf7", LrsLastArg);
lrs_send("socket2", "buf8", LrsLastArg);
lrs_accept_connection("socket0", "socket3");
lrs_receive("socket3", "buf9", LrsLastArg);
lrs_save_searched_string("socket3",NULL, "param1",NULL, NULL, -1, 103, 1);
lrs_send("socket3", "buf10", LrsLastArg);
lrs_set_receive_option(EndMarker, EndMarker_None);
lrs_receive("socket3", "buf11", LrsLastArg);
lrs_save_searched_string("socket3",NULL, "param2",NULL, NULL, -1, 83, 2);
lrs_send("socket3", "buf12", LrsLastArg);
lrs_receive("socket2", "buf13", LrsLastArg);
lrs_receive("socket3", "buf14", LrsLastArg);
lrs_save_searched_string("socket3",NULL, "param2",NULL, NULL, -1, 83, 2);
lrs_send("socket3", "buf15", LrsLastArg);
lrs_receive("socket2", "buf16", LrsLastArg);
lrs_receive("socket3", "buf17", LrsLastArg);
lrs_send("socket3", "buf18", LrsLastArg);
lrs_close_socket("socket3");
lrs_receive("socket2", "buf19", LrsLastArg);
lrs_send("socket2", "buf20", LrsLastArg);
lrs_receive("socket2", "buf21", LrsLastArg);
lrs_close_socket("socket2");
lr_end_transaction("3", LR_AUTO);
lr_start_transaction("4");
lrs_close_socket("socket0");
lr_end_transaction("4", LR_AUTO);
return 0;
}
[ 本帖最后由 liumm 于 2010-3-24 17:17 编辑 ] |
|