51Testing软件测试论坛

标题: 我的通讯协议生成脚本问题 [打印本页]

作者: tanwen321    时间: 2008-11-21 17:45
标题: 我的通讯协议生成脚本问题
下面的脚本是我使用windows socket协议录制的脚本(就是test001用客户端向用户test002发送信息和表情的一个动作),运行,回放都是没有问题的。可我进行运行负载测试的时候,设置了10个人陆续上线,可就是只能一个人上线成功,我想是要参数化脚本,可我不知道该怎么做?谁可以指点一下


/*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder
*
* Created on: Fri Nov 21 11:25:01
*********************************************************************/

#include "lrs.h"


Action()
{
    lrs_create_socket("socket0", "TCP", "RemoteHost=QQTECH-CRM:9090",  LrsLastArg);

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

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

    lrs_disable_socket("socket0", DISABLE_SEND_RECV);

    lrs_close_socket("socket0");

    lrs_create_socket("socket1", "TCP", "RemoteHost=QQTECH-CRM:5200",  LrsLastArg);

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

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

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

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

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

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

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

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

    lrs_create_socket("socket3", "TCP", "LocalHost=0", "RemoteHost=QQTECH-CRM:9090",  LrsLastArg);

    lrs_send("socket3", "buf10", LrsLastArg);

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

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

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

    lrs_send("socket3", "buf14", LrsLastArg);

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

    lrs_send("socket3", "buf16", LrsLastArg);

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

    lrs_send("socket3", "buf18", LrsLastArg);

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

    lrs_send("socket3", "buf20", LrsLastArg);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    lrs_close_socket("socket3");

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

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

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

    lr_think_time(6);

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

    lr_think_time(12);

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

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

    lr_think_time(8);

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

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

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

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

    lr_think_time(10);

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

    lr_think_time(8);

    return 0;
}
作者: wistaria    时间: 2008-11-21 17:49
发这个文件没用的~!看不出任何数据,
你看看data.ws这个文件,
里面有所发送或接受的数据包,
在数据包里面查找需要参数化的数据!
作者: tanwen321    时间: 2008-11-21 18:25
data.wl就是录制日志?我找到参数要怎么才能使生成的脚本参数化?
作者: wistaria    时间: 2008-11-21 18:39
不是,去看一下有关参数化文章,应该不难懂!




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2