|
下面是我写的脚步用来验证窗口是否存在:
Sub Main
Dim Result As Integer
'Initially Recorded: 8/5/2005 3:05:35 PM
'Script Name: Test
'Start Application
StartApplication """C:\Program Files\Rational\Rational Test\Sample Applications\Classics Online\ClassicsA.exe"""
Window SetContext, "Name=frmExistingLogin", ""
PushButton Click, "Name=cmdOK"
Window SetContext, "Name=frmMain", ""
PushButton Click, "Name=cmdOrder"
Window SetContext, "Name=frmOrder", ""
EditBox Left_Drag, "Name=txtCreditCard", "Coords=95,7,-23,5"
InputKeys "11111222233334444"
EditBox Left_Drag, "Name=txtExpirationDate", "Coords=17,11,-39,5"
InputKeys "1212"
PushButton Click, "Name=cmdOrder"
'Verify window existence
Result = WindowVP (Exists, "Name=frmConfirm", "VP=Window Existence")
Window SetContext, "Name=frmConfirm", ""
PushButton Click, "Name=cmdOK"
'Verify window existence
'Result = WindowVP (Exists, "Name=frmConfirm", "VP=Window Existence")
Window SetContext, "Name=frmMain", ""
MenuSelect "File->Exit"
End Sub
我发觉验证的这个语句:Result = WindowVP (Exists, "Name=frmConfirm", "VP=Window Existence")
放在窗口出来之后或者窗口消失以后,验证的结果都是一样的,不知道脚本有没有什么问题。等待回复。谢谢! |
|