Window SetContext, "Caption=MSTP通用查询", ""
Result = SQAGetProperty("type=Window;Caption=MSTP通用查询","Enabled",i)
If Result = 0 then
If i = -1 then
Msgbox("Enable")
Else
Msgbox("Disabled")
End if
Else
Msgbox(Cstr(Result))
Msgbox("fail")
End if
脚本运行报错,错误码是1003,是sqaObjectNotFound。我知道肯定是SQAGetProperty语句有问题,但是不知道怎么才正确。请高手们赐教。。。感谢作者: 5am 时间: 2006-8-17 09:27
改用window验证点呢?作者: liangl923 时间: 2006-8-21 17:46
enableb 换成其他的关键字看看作者: caesarqth 时间: 2006-8-21 18:20
用SQAWaitForPropertyValue应该可以吧作者: liangl923 时间: 2006-8-21 20:15
Sub main
Dim i
Dim Result
Dim Result1
Dim Result2
'''Window SetContext,"Type=Window;Caption=无标题 - 记事本" ,"1"
Result = SQAFindObject("Type=Window;Caption=无标题 - 记事本")
''''Result1 = SQAFindObject("Type=Window;Caption=无标题 - 记事本")
Result = SQAGetProperty("Type=Window;Caption=无标题 - 记事本","Enabled",i)
If Result = sqaSuccess then
If i = True then
Msgbox("Enable")
Else
Msgbox("Disabled")
End if
Else
Msgbox(Cstr(Result))
'Msgbox("fail")
End if
End Sub
'Window SetContext帮助里有这么一段:
If this command fails during playback (for example, if the specified window cannot be found), an error is logged, but playback continue regardless of the playback option for script command failures.