WjQ2SU$q vMJTH0目标::大数据量
测试(100个用户)时,我的
脚本设置为第一个模拟用户登陆成功后,接着退出系统,然后第二个用户登陆,登陆成功后,接着退出系统,如此循环100次。脚本通过了。测试结果 PASS,符合我的要求。
51Testing软件测试网9]4S0g+a a7v;hi/_
J51Testing软件测试网:h8QNQdq$i!U&O2T'$Include "SQAUTIL.SBH"
:tss;BRa0Sub Main
&W@.s
UZ/d3t6^.caj0 Dim Result As Integer
51Testing软件测试网AlU@9@3u}w;wA*cx6\~!E$|C0 dim i as integer
m*dn6M(B8c3e'`0 dim username as string
/Wi5F A@P&jA'xP0 dim pwd as string
wRn F/Z;G.`;r?0 51Testing软件测试网W6`/`,vr9De dim dp as long
T\[;AIqc051Testing软件测试网s`{N:iN;T4` Xn[^1yeN*`(J0 'Initially Recorded: 2005-12-19 17:34:27
51Testing软件测试网;MgF5aaw PG%M 'scrīpt Name: 5
km#z/}!N0gA'jGT0 51Testing软件测试网LU I(^JaN:S0c Window SetContext, "Class=Shell_TrayWnd", ""
51Testing软件测试网lo*ItdL&P TabControl Click, "ObjectIndex=1;\;ItemIndex=0", ""
M$sF:_
aH$o0 StartApplication """F:\GPS 0.1test\gps\GpsClent.exe"""
5D
?z&c)pW%P#A8wS
Ni9x0 0[p`PRh0 dp=SQADatapoolOpen("login")
7}3q+E S0@q0 for i=1 to 100
51Testing软件测试网T3TE K5y Call SQADatapoolFetch(dp)
51Testing软件测试网b ah:E``tvb Call SQADatapoolValue(dp,1,username)
51Testing软件测试网q^OV.I"D"q Call SQADatapoolValue(dp,2,pwd)
e"D#DRzxrU3x?f051Testing软件测试网AKub nZ(C Aq,w1E%`4a$J'~0 Window SetContext, "Caption=监控端", ""
51Testing软件测试网5V1U;dc4m)j!]A Window Click, "", "Coords=30,-13"
$f Ebd8Zt~S.zY0 PopupMenuSelect "登陆"
51Testing软件测试网 LR3h#v.q![ 51Testing软件测试网d(b:sy3s[%~X#C"H\i Window SetContext, "Caption=登录", ""
51Testing软件测试网Z
h[yX V+B4a InputKeys username
51Testing软件测试网9Q.cZ Z.a2G O EditBox Click, "ObjectIndex=2", "Coords=13,8"
51Testing软件测试网+d;b8?_S InputKeys pwd
51Testing软件测试网mD,cNf 51Testing软件测试网x}:O
K J3cl%q[ Window SetContext, "Class=Shell_TrayWnd", ""
Kg*kf[?1SQ0 TabControl Click, "ObjectIndex=1;\;ItemIndex=3", ""
HOPS V8AgY*i
S0 1|#{.d$BY/m[I9L0 Result = WindowVP (CompareNumeric, "Caption=登录", "VP=Alphanumeric;Value=0")
|UM$k%CF0 51Testing软件测试网9e9Z@9gIK6j$~ Window SetContext, "Caption=登录", ""
51Testing软件测试网q[.V8k,{G1|C&W(EuMe PushButton Click, "Text=确定"
51Testing软件测试网e@)f*{(cy0jc 51Testing软件测试网\i(XCt)T Window SetContext, "Caption=监控端", ""
51Testing软件测试网3^/}
rK mXs6|9N Window Click, "", "Coords=35,-16"
G;nF8_ w0|w2M)D0 PopupMenuSelect "退出登陆"
j]?J9V0 51Testing软件测试网%?@s#Ins#v/p next
51Testing软件测试网8d)H#qa&V Call SQADatapoolClose(dp)
51Testing软件测试网$aa
H)Xo]8Iu 51Testing软件测试网#~XO}$r}tvDy Window Click, "", "Coords=29,-12"
Mo/[e.zo*b
z
D"u0`0 PopupMenuSelect "退出"
51Testing软件测试网X%Lv6a*iD 2H c2V8p9[ b[2c:\0 Window SetContext, "Class=Shell_TrayWnd", ""
)`s7r"xV
K0 TabControl Click, "ObjectIndex=1;\;ItemIndex=3", ""
-ht&?'?h:zm`0 sj$eCw0End Sub