Result = SQAWaitForPropertyvalue("Text=(O)确定", "Enabled",TRUE, 2000)
If Result <> sqaSuclearcase/" target="_blank" >ccess Then
print "确定按钮未出现"
Else
PushButton Click, "Text=(O)确定"
End If
2).2秒内假若出现标题为"Title abcd" 的窗体,打印"出现标题为Title abcd的窗体" ,否则打印"未出现标题为Title abcd的窗体" :等待2秒直到标题为Title abcd的窗体出现.
Result = SQAWaitForPropertyvalue("Caption=Title abcd", "Enabled",TRUE, 2000)
If Result <> sqaSuccess Then
PushButton Click, "Text=(O)确定"
print "出现标题为Title abcd的窗体"
Else
print "未出现标题为Title abcd的窗体"
End If
说明:
1).Result是一个Integer型变
2).SQAWaitForPropertyvalue:顾名思义,指的是等待一个属性被指定值之前暂停执行。SQAWaitForPropertyvalue("Text=(O)确定", "Enabled",TRUE, 2000)表示等待2秒直到确定按钮出现,如果2秒内未出现,则返回sqlfalse,出现则返回sqlsuccess;
3).SQA Basic中<>表示不等于;
4).另外,可以用SQAWaitForObject来判断出现出现的对象类型:
Result = SQAWaitForObject("Type=PushButton;Text=OK", 2000)
If Result = sqaSuccess Then
... ' add the rest of the actions/tests here
End If