|
本人今天用robot调试脚本的时候,为何SQAWaitForPropertyvalue 函数的返回值是1016(sqatimeout)呢,源码如下 :
Sub Main
Dim Result As Integer
Dim Result2 As Integer
Dim Result3 As Integer
dim yjk as integer
dim j as integer
i=111100000009669
'Initially Recorded: 2005-11-28 14:44:08
'Script Name: gdjh_wdfh
for j=1 to 10000
Window SetContext, "Name=mainform", ""
InputKeys i & "{ENTER}"
i=i-1
Result = SQAWaitForPropertyvalue("Caption=提示", "Enabled",TRUE, 6000)
msgbox Result
If Result <> sqaSuccess Then
PushButton Click, "Text=确定"
Result2 = SQAWaitForPropertyvalue("Caption=错误!", "Enabled",TRUE, 1000)
msgbox result
PushButton Click, "Text=确定"
End if
'delayfor(5500)
'Window SetContext, "Name=mainform", ""
'InputKeys "1{ENTER}2{ENTER}{NUM+}{NUM*}"
Window SetContext, "Name=mainform", ""
InputKeys "1{ENTER}"
Window SetContext, "Name=mainform", ""
InputKeys "2{ENTER}"
Window SetContext, "Name=mainform", ""
InputKeys "{NUM+}"
Window SetTestContext, "Caption=错误!", ""
yjk = SQAWaitForPropertyvalue("Caption=错误!", "Enabled",TRUE, 9000) ;这里的返回值是1016,此窗口已经出现了,不是过vb的msgbox弹出的对话框。
msgbox YJK
If yjk = sqaSuccess Then
Window SetContext, "Caption=错误!", ""
PushButton Click, "Text=确定"
Window SetContext, "Name=mainform", ""
InputKeys "{NUM*}"
Window SetContext, "Caption=提示信息", ""
PushButton Click, "Text=否(N)"
End if
Window SetContext, "Name=mainform", ""
InputKeys "{NUM*}"
'delayfor(9000)
Result3 = SQAWaitForPropertyvalue("Caption=提示", "Enabled",TRUE, 8000)
'msgbox result3
if Result3 <> sqaSuccess Then
PushButton Click, "Text=是(Y)"
End if
next j
'msgbox result3
End Sub
哪位高手告诉我,应该如何解决呢?? |
|