51Testing软件测试论坛

标题: 紧急求助 loadrunner [打印本页]

作者: zengyin316    时间: 2006-8-2 17:17
标题: 紧急求助 loadrunner
我现在要测试一个类似与 MSN的通信系统的性能,数据库采用的是MySQL ,连接方式为MySql的动态链接库,首先协议应该怎么选择啊,我选择了winSocket协议,也能录制,但我想加入参数,因为至少要模拟10个用户并发操作嘛,提供不用的用户名和密码,我录的登陆脚本如下:
#include "lrs.h"

vuser_init()
{
    lrs_startup(257);

    lr_think_time(32);

    lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=202.101.165.141:5222",  LrsLastArg);

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

    lrs_create_socket("socket1", "UDP", "LocalHost=5224",  LrsLastArg);

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

    lrs_send("socket1", "buf2", "TargetSocket=202.101.165.141:5225", LrsLastArg);

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

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

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

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

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

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

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

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

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

    return 0;
}
我应该在哪里填加参数啊,实在摸索不错来,网高手给予帮助,谢谢啦!sdlkfj7
作者: Zee    时间: 2006-8-2 17:57
看data.ws。
作者: zengyin316    时间: 2006-8-2 18:30
;WSRData 2 1

send  buf0 121
        "<stream:stream to=\"202.101.165.141\" xmlns=\"jabber:client\" xmlns:stream"
        "=\"http://etherx.jabber.org/streams\" version=\"1.0\" >"

recv  buf1 189
        "<?xml version='1.0'?><stream:stream xmlns:stream='http://etherx.jabber.org"
        "/streams' xmlns='jabber:client' from='202.101.165.141' version='1.0' id='1"
        "jgolri3d7aoedbhm29eu0xg25itvrrxa7lwy40c'>"

send  buf2 17
        "SICQ GET UDP INFO"

recv  buf3 19
        "60.191.58.216:10450"

send  buf4 92
        "<iq id=\"jcl_1\" type=\"get\"><query xmlns=\"jabber:iq:auth\"><username>aa"
        "</username></query></iq>"

recv  buf5 405
        "<stream:features xmlns:stream='http://etherx.jabber.org/streams'><mechanis"
        "ms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>DIGEST-MD5</mechani"
        "sm><mechanism>PLAIN</mechanism></mechanisms></stream:features><iq xmlns='j"
        "abber:client' id='jcl_1' type='result'><query xmlns='jabber:iq:auth'><user"
        "name>aa</username><resource/><password/><digest/><sequence>495</sequence><"
        "token>44CF184F</token></query></iq>"

send  buf6 170
        "<iq id=\"jcl_2\" type=\"set\"><query xmlns=\"jabber:iq:auth\"><username>aa"
        "</username><resource>CTCQ</resource><hash>fa1f7b3d5afc877ca5b1c5d96418c45f"
        "09966276</hash></query></iq>"

recv  buf7 52
        "<iq xmlns='jabber:client' id='jcl_2' type='result'/>"

send  buf8 321
        "<iq id=\"jcl_3\" type=\"get\"><query xmlns=\"jabber:iq:roster\"/></iq><pre"
        "sence><status>鑱旀満</status><priority>1</priority></presence><iq id=\"jcl"
        "_4\" to=\"202.101.165.141\" type=\"get\"><query xmlns=\"jabber:iq:agents\""
        "/></iq><iq id=\"jcl_5\" type=\"get\"><query xmlns=\"jabber:iq:private\"><s"
        "torage xmlns=\"storage:imprefs\"/></query></iq>"

recv  buf9 157
        "<iq xmlns='jabber:client' type='result' id='jcl_3'><query xmlns='jabber:iq"
        ":roster'><item name='s' subscription='none' jid='aa@202.101.165.141'/></qu"
        "ery></iq>"

send  buf10 164
        "<iq id=\"jcl_6\" to=\"aa@202.101.165.141\" type=\"get\"><vCard xmlns=\"vca"
        "rd-temp\"/></iq><iq id=\"jcl_7\" to=\"aa@202.101.165.141\" type=\"get\"><v"
        "Card xmlns=\"vcard-temp\"/></iq>"

recv  buf11 626
        "<iq xmlns='jabber:client' type='result' id='jcl_5'><query xmlns='jabber:iq"
        ":private'><storage xmlns='storage:imprefs'/></query></iq><iq xmlns='jabber"
        ":client' id='jcl_4' from='202.101.165.141' to='aa@202.101.165.141/CTCQ' ty"
        "pe='result'><query xmlns='jabber:iq:agents'/></iq><iq xmlns='jabber:client"
        "' id='jcl_6' from='aa@202.101.165.141' to='aa@202.101.165.141/CTCQ' type='"
        "result'><vCard xmlns='vcard-temp'><FN>s</FN><NICKNAME>s</NICKNAME></vCard>"
        "</iq><iq xmlns='jabber:client' id='jcl_7' from='aa@202.101.165.141' to='aa"
        "@202.101.165.141/CTCQ' type='result'><vCard xmlns='vcard-temp'><FN>s</FN><"
        "NICKNAME>s</NICKNAME></vCard></iq>"

我用的用户名是aa,密码是1应该在那里添加参数啊,所有的aa都呀改吗,谢谢啦,在线等回答!
作者: Zee    时间: 2006-8-2 23:19
参数化就是了,这不是有aa和1吗?
作者: zengyin316    时间: 2006-8-3 09:10
aa我是找到了,可1没找到啊,aa出现过几次,我应该在哪里替换为参数啊,谢谢了,期盼回答,我是新手,才刚接触,确实有很多问题不明白,望给予解答!
作者: zengyin316    时间: 2006-8-3 10:39
我刚才把aa替换为参数了,但是在 contorller中运行失败,我应该选什么脚本在controller中运行啊,data.ws可以吗
作者: Zee    时间: 2006-8-3 12:04
什么错?
作者: zengyin316    时间: 2006-8-3 12:26
Done.Failed
作者: zengyin316    时间: 2006-8-3 12:27
运行的时候出现的,没运行成功,所有的虚拟用户都是这样
作者: Zee    时间: 2006-8-3 15:16
你的描述超模糊。




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