51Testing软件测试论坛
标题:
在LR中,为何在跑压力测试的时候,虚拟用户一直停在初始化状态呢?
[打印本页]
作者:
xuefeng
时间:
2007-7-4 17:03
标题:
在LR中,为何在跑压力测试的时候,虚拟用户一直停在初始化状态呢?
我今天录了段脚本,是socket协议的,测试C/S系统的登录.录入的脚本回放的时候可以运行,而且在回放的时候也可以迭代,但是在跑2个虚拟用户的时候,就一直停在初始化状态,下面是录制的脚本.
vuser_init
/* -------------------------------------------------------------------------------
Script Title :
Script Description :
Recorder Version : 1196
------------------------------------------------------------------------------- */
vuser_init()
{
return 0;
}
Action
Action()
{
lrs_create_socket("socket0", "TCP", "RemoteHost=192.168.1.230:1700", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lr_think_time(5);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_send("socket0", "buf2", LrsLastArg);
lrs_receive("socket0", "buf3", LrsLastArg);
lrs_send("socket0", "buf4", LrsLastArg);
lrs_close_socket("socket0");
lrs_create_socket("socket1", "TCP", "RemoteHost=192.168.1.230:1700", LrsLastArg);
lrs_send("socket1", "buf5", LrsLastArg);
lrs_receive("socket1", "buf6", LrsLastArg);
lrs_send("socket1", "buf7", LrsLastArg);
lrs_receive("socket1", "buf8", LrsLastArg);
lrs_send("socket1", "buf9", LrsLastArg);
lrs_close_socket("socket1");
lrs_create_socket("socket2", "TCP", "RemoteHost=192.168.1.230:1700", LrsLastArg);
lrs_send("socket2", "buf10", LrsLastArg);
lrs_receive("socket2", "buf11", LrsLastArg);
lrs_send("socket2", "buf12", LrsLastArg);
lrs_receive("socket2", "buf13", LrsLastArg);
lrs_send("socket2", "buf14", LrsLastArg);
lrs_close_socket("socket2");
return 0;
}
vuser_end
[
本帖最后由 xuefeng 于 2007-7-4 17:09 编辑
]
作者:
xuefeng
时间:
2007-7-4 17:04
data.ws
;WSRData 2 1
send buf0 39
"\x00\x01\x00\x1b\x01\x02"
"&&&&&&&&&&&&&&&&&&&0"
"\x00"
"0"
"\x00"
"BJAUTEKEND"
recv buf1 16
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
send buf2 16
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
recv buf3 430
"還 >"
"\xe4"
"4"
"\x02"
"\n"
"\x05\x7f"
"枭M瓷O敓"
"\xc8"
"$賂缛屍"
"\xc9\x1e"
"峌婞y泯"
"\x15"
"尀>\""
"\x1e"
" qg"
"\xab\x1d"
"(终幘伦璔&v蛢<g怏!靾"
"\x05"
"拫圆"
"\x15"
"鞐匚\v'屒Y\v潭碃缲"
"\x90"
"\"i玹呴4j\\\r\f"
"\xa4"
"5K扚"
"\xa9\x0e"
"i奍~O+"
"\x8a\x7f"
"T"
"\x89"
")l蕳藭M驋-┑S戧W"
"\x14"
"鐃跒U/仁Q"
"\x14"
"哗="
"\x16"
"R靴f売\rU5"
"\x04"
"ei┮摝梖摑藺G槁A騁,"
"\x1f"
"R"
"\x14\xaa"
">L凒"
"\x86"
"\"Y\a處`"
"\x7f"
"d|!D"
"\x1f"
"+r"
"\xe3"
"%恷b4"
"\x1c\x1f"
"N冭皚^"
"\x0f"
"畯⿴"
"\x1c"
">"
"\x83"
"."
"\xd6"
")"
"\x1f\x14"
"q鯝鯤>"
"\xcb\x16"
"鐮X>"
"\xc2"
">=>"
"\xdc"
">4n贐軀||瞏"
"\xf9"
">嫡"
"\x1f"
"^趶 NZ厪浿燔n"
"\x18"
"u亅"
"\xb6\x1b"
"赱"
"\xe0\x1b"
"鶑[8贇"
"\x7f"
"Z4"
"\xba"
"5R萯啓\b"
"\x11"
";"
"\x88"
"\b^"
"\x04"
",鋚\b"
"\x99\x02\x02"
" A"
"\x1c\x00\x87\x00"
"@"
"\xb0"
"!詝"
"\xac\x04"
">"
"\x82"
"\aA"
"\x0e"
"o(驘牐A#"
"\xde"
"\b\f勽"
"\x14\x03\x10"
"})堀"
"\xc6\x04"
"\\"
"\x91\x02"
"2"
"\xd5\x18"
"蕟缻E"
"\xf8\x04\x19\x82"
"\f"
"\x1b"
"'爞謄彁A庰A"
"\x00"
" 枋\b71"
"\x17\x04\x1b\x1b\x93\x13"
"\f郃UTEKEND"
send buf4 34
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
"\x00\x01\x00\x06\x01\x05\x00"
"\t"
"\x00\x00"
"AUTEKEND"
send buf5 43
"\x00\x01\x00\x1f\x01\x02"
"&&&&&&&&&&&&&&&&&&&15501"
"\x00"
"0"
"\x00"
"BJAUTEKEND"
recv buf6 16
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
send buf7 16
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
recv buf8 447
"還 >"
"\xe4"
"4"
"\x02"
"\n"
"\x05\x7f"
"枭M瓷O敓"
"\xc8"
"$賂缛屍"
"\xc9\x1e"
"峌婞y泯"
"\x15"
"尀>\""
"\x1e"
" qg"
"\xab\x1d"
"(终幘伦璔'v蛢<g怏!鴭!l"
"\xfe"
"2Q"
"\x99"
","
"\x1c"
"Y"
"\x9c\x16"
"O"
"\x19"
"庼"
"\x17"
"檓gA媳-"
"\x80"
"齐"
"\x12\xa9"
"'Si"
"\x1e"
"\f"
"\x94"
"5+桺J"
"\x1c"
"乱捯D"
"\xa2\x15"
"纯〥挾"
"\x16"
"曭\\K|攱)mR"
"\xe4"
"-*鈂"
"\xee\x11"
"K蕰*\"WtБ)_寅0"
"\x95"
"(i艈"
"\x8b"
"*"
"\x1c\x11\x80"
"1bづ'"
"\x14"
"鍽蠶簆"
"\x10"
"l憣"
"\x04"
" 苣F誘"
"\x1b\xcb\x16\x82"
"*6d剢"
"\xc2\x0f"
"[C{蚫\n"
"\r"
"\xc0"
",N"
"\x10"
"l緀僯{N儃皀。~HH"
"\x11"
"跺p鼚攳"
"\xf7\x00\xb6"
","
"\xcb"
"6\r璔磥福钠覩\r"
"\x8e"
"\r"
"\x8c"
"\r帊姷斯鋔"
"\x04"
"g膄0p"
"\x17\x14\xb4"
"5fHcHd飩4=<哱"
"\xdf"
"=\f藼"
"\x1a"
"\n"
"\x1c"
"\vuG"
"\x03\xf4"
"\tq+"
"\x90"
"+媽"
"\x1f"
"+"
"\xdd\x14"
"菅軨輀"
"\xdd\x1f"
"軪"
"\x02"
"瑍"
"\x17"
"\a"
"\x11\x10"
"蚱"
"\x0e"
"0筝嬅舳旆"
"\xf7"
"\n"
"綑"
"\x84"
"\r諠覷Z"
"\xd3\x1b"
"t2敒隌B谪铊"
"\xb5\x05"
"砌In\n"
" >鐸\f頓PM~"
"\x1a\x88"
";隡"
"\xee\x0e"
"枛@\\;8"
"\x02"
"蔯j薗囵嚯擎B"
"\x9e"
"."
"\x8a\x1d"
"WQ"
"\x7f\x19\x1a\x05\xb6"
"\"Iz"
"\x0e"
"\t"
"\x00"
"AUTEKEND"
send buf9 34
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
"\x00\x01\x00\x06\x01\x05\x00"
"\t"
"\x00\x00"
"AUTEKEND"
send buf10 42
"\x00\x01\x00\x1e\x01\x02"
"&&&&&&&&&&&&&&&&&&&2202"
"\x00"
"0"
"\x00"
"BJAUTEKEND"
recv buf11 16
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
send buf12 16
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
recv buf13 352
"還 >"
"\xe4"
"4"
"\x02"
"\n"
"\x05\x7f"
"枭M瓷O敓"
"\xc8"
"$賂缛屍"
"\xc9\x1e"
"峌婞y泯"
"\x15"
"尀>\""
"\x1e"
" qg"
"\xab\x1d"
"(终幘伦璔'v蛢<g怏!鴭 烃2Q"
"\x99"
","
"\x1c"
"Y"
"\x9c\x16"
"O"
"\x19"
"庼"
"\x17"
"檓gA媳-"
"\x80\x19\xe2\x17"
"WNσ=D硎"
"\xb5"
"3畠O\r衦佃杛u胄呏窱sa"
"\x7f"
">N"
"\x98"
"-|X娸俒\\窛"
"\xbb\x7f"
"pm蛉跠讹l鬴費符~墍Kp皱Gz@翸簺i6閏秗仑-簉栙!\f"
"\x06"
"A垺o-"
"\x04"
"R[fA沘\t-芥牊"
"\x02\xe0\x16\x18"
"/\v9@储Qp^燸"
"\xec"
"\v╣"
"\x10"
"\r"
"\xde\x13"
"/"
"\xe0"
"%朹a稣恑降4sh鉮胔雋淹╩"
"\xa6"
"1"
"\x03"
"贝&"
"\xd5"
"\f8V"
"\x16"
"恚銝槯6犩『趮[`L跡"
"\xa4\x00"
"q+m觟"
"\x03"
"h笢兮搄薸觢Z"
"\x1a"
"煤耽JR裬K禖灦鏜"
"\x9e"
"\n"
"y AUTEKEND"
send buf14 34
"\x00\x01\x00\x04\x01\x04"
"u0AUTEKEND"
"\x00\x01\x00\x06\x01\x05\x00"
"\t"
"\x00\x00"
"AUTEKEND"
-1
作者:
xuefeng
时间:
2007-7-4 17:05
globals.h
#ifndef _GLOBALS_H
#define _GLOBALS_H
//--------------------------------------------------------------------
// Include Files
#include "lrun.h"
#include "lrs.h"
//--------------------------------------------------------------------
// Global Variables
#endif // _GLOBALS_H
作者:
xuefeng
时间:
2007-7-4 17:07
我用的是lr8.1汉化版.
问题一: 我在哪里可以看到我登录的用户名用密码
问题二:data.ws中为何会有乱码?是否会影响到系统测试
问题三:为何回放可以通过,且可以迭代,但生成虚拟用户后运行的时候一直是停在初始化状态.直到后来报超时错误.
作者:
tangyh
时间:
2007-7-4 17:12
标题:
可不可以给我一个lr8.1汉化版.
谢了,邮箱
tangyunhui520@hotmail.com
作者:
xuefeng
时间:
2007-7-4 18:01
有人可以回答一下我吗?好困惹啊
作者:
rickyzhu
时间:
2007-7-4 18:24
标题:
回复 #4 xuefeng 的帖子
1,登录名和密码可以在代码里面打印一些log, lr_output_message,就可以看到了。
2,不影响测试
3,这个问题需要进一步分析,你提供的信息不够,可能是服务器的原因,最有可能是你设置的问题
作者:
rickyzhu
时间:
2007-7-4 18:26
标题:
回复 #5 tangyh 的帖子
LR的包至少要800M,你的邮箱装的下?
另外,英文版比较稳定,为什么一定要汉化版?如果连LR的英文菜单和界面都看不懂,建议你好好补习以下英文了。
作者:
xuefeng
时间:
2007-7-5 09:38
To rickyzhu
倒不是说看不懂英文,只是刚接触这个工具.
你觉得有可能是服务器的问题.或者说是设置的问题.那应该从哪里入手去解决这个问题呢
还需要我提供些什么信息呢?
帮我找找原因吧,多谢了
[
本帖最后由 xuefeng 于 2007-7-5 09:39 编辑
]
作者:
Provence
时间:
2007-7-6 11:38
标题:
在LR中,为何在跑压力测试的时候,虚拟用户一直停在初始化状态呢?
我也有同样的问题,同样的脚本在他人机器上可以在场景里运行,但是放在我的机器上就一直停留在登录操作那里。不知道是什么原因。。。很急啊。。。
作者:
zhsm8525
时间:
2007-7-6 12:04
建议看看自带的帮助!!!
作者:
guxingyun
时间:
2007-7-18 17:27
标题:
回复 #2 xuefeng 的帖子
从#1代码和#2data可以看出来你进行了三次登录推出的操作,,不知是否正确。作出这样的判断是因为看到creatsocket和closesocket各三次,并且data里面的内容存在相似性,如果是这样的话,那么这段代码可以只使用socket0这个就可以了,至于socket1和socket2类似于迭代了两次。关于跑2个虚拟用户会出现停留在初始化状态的情况倒是比较奇怪,因为我做这样的测试时出现过的情况是一个成功,一个提示socket已存在而失败。
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2