'$include "sqautil.sbh"
51Testing软件测试网h7^/p;?'d"kDX-ASub Main
R_/nLzX/~vdd0 Dim Result As Integer
dc(LwqDY&]0 dim x as integer
51Testing软件测试网K\9}z"C|"z0x;ve dim dp as long
b!?h0x,E^$p%z\^0 dim dpname as string
5pj4S~
T0 dim password as string
d
o7E1G)[ c2F(Pj0b051Testing软件测试网+u'a%^${DrK} StartApplication """D:\Program Files\Rational\ClearQuest\clearquest.exe"""
51Testing软件测试网/}v r:Fc6K
k0\
\ dp = sqadatapoolopen("test-cq")
P]] I PB"i0 for x=1 to 2
51Testing软件测试网W-S/UkQ call sqadatapoolfetch(dp)
"?D;Y8P0K/wnK,^0 call sqadatapoolvalue(dp,1,dpname)
51Testing软件测试网xj#b|'p oC{3F call sqadatapoolvalue(dp,2,password)
51Testing软件测试网v r3f|c$cWu8R call sqadatapoolvalue(dp,3,cctype)
51Testing软件测试网%sm'a!sS Window SetContext, "Caption=Rational ClearQuest Login", ""
51Testing软件测试网6\ S^3z8W6RgW EditBox DblClick, "Label=User Name", "Coords=10,6"
G,[
WK!x#U1C0 msgbox dpname
51Testing软件测试网A.R@qb5c#N2TI InputKeys dpname
!]^-`4sxnwQ2H @0 EditBox DblClick, "Label=Password", "Coords=5,10"
51Testing软件测试网*wm\0Z#]@z msgbox password
51Testing软件测试网Vnh5`9J;RJ%V(D InputKeys password
51Testing软件测试网]7E+Px
H#\*BUu ComboBox Click, "Label=Database", "Coords=153,12"
-q3oPU8S7f0 ComboListBox Click, "Label=Database", "Text=RSDF : "
51Testing软件测试网wr$UY|M
G
V PushButton Click, "Text=OK"
4q.pp-`W}-X0 51Testing软件测试网}[!SJU x result=SQAWaitForObject("\;Type=Window;Caption=Warning - Invalid Login",8000)
@
yj?[?0 MSGBOX result
51Testing软件测试网y3jXN9U,J.` //x=1返回0 x=2 返回1016 --1016是指在指定的时间内没有找到对象
51Testing软件测试网Q `&WVC|K7{7M result=SQAFindObject("\;Type=Window;Caption=Warning - Invalid Login")
51Testing软件测试网;fA)M%TPL:`~ msgbox result
51Testing软件测试网9Lh W!~QP
B4R#Q //x=1返回0 x=2 返回1003
7m&X"j]WS5yn0 if result=sqasuccess then
i'`.^9e7vK0 msgbox "fail"
gg+EvJK$yn~0 Window SetContext, "Caption=Warning - Invalid Login", ""
rS|*slO*W!XiOQ0 PushButton Click, "Text=OK"
jz*yW oc0 else
51Testing软件测试网6w0l.v,U+]t msgbox "ok"
51Testing软件测试网IaB NdN Window SetContext, "Caption=Rational ClearQuest - RSDF :", ""
N2n7O``oR9x!N4F0W0 Window CloseWin, "", ""
51Testing软件测试网"FpO-c.FF;l end if
51Testing软件测试网4f/ZGQ%T1c4Yg next x
51Testing软件测试网~K&h^Czj8n$A4P,TEnd Sub
51Testing软件测试网8j|Siu BFNgA MB;AqD0有待完善..............
L@giT4Hv0