sky2008 2006-10-27 11:26
判断提神
有提示信息弹出时,脚本执行通过,但是无提示信息弹出时,脚本无法执行,脚本应该继续执行end if 下的退出才对! ..调试1当有提示时Result等于1,是正确的,PASS;调试2当无提示Result等于0,也是正确的..但为什么不继续执行end if下的呢?? 一直停留在if 下提示脚本处(wait for windows) 请问是什么原因????急
Sub Main
Dim Result As Integer
delayfor(5000)
Result = WindowVP (Exists, "Caption=提示", "VP=Window Existence;Wait=1,3")
If Result = 1 Then
Window SetContext, "Caption=提示", ""
PushButton Click, "ObjectIndex=4"
end if
Window SetContext, "Caption=计算机;ChildWindow", ""
PushButton Click, "ObjectIndex=3"
Window SetContext, "Caption=提示", ""
PushButton Click, "ObjectIndex=2"
End Sub
colume 2006-11-1 19:33
Sub Main
Dim Result As Integer
delayfor(5000)
Result = WindowVP (Exists, "Caption=提示", "VP=Window Existence;Wait=1,3")
If Result = 1 Then
Window SetContext, "Caption=提示", ""
PushButton Click, "ObjectIndex=4"
else
Window SetContext, "Caption=计算机;ChildWindow", ""
PushButton Click, "ObjectIndex=3"
Window SetContext, "Caption=提示", ""
PushButton Click, "ObjectIndex=2"
end if
End Sub
你这样试试,我估计效果差不多,呵呵
dionysus 2006-11-1 23:01
[quote]原帖由 [i]sky2008[/i] 于 2006-10-27 11:26 发表
有提示信息弹出时,脚本执行通过,但是无提示信息弹出时,脚本无法执行,脚本应该继续执行end if 下的退出才对! ..调试1当有提示时Result等于1,是正确的,PASS;调试2当无提示Result等于0,也是正确的..但为什么不继续 ... [/quote]
wait for windows ?
看样子应该是robot没有找到窗体啊,是否楼主的Window SetContext 语句定位的窗体Caption有错误呢?
sky2008 2006-11-2 19:51
不行.无论是有无提示窗口 Result = WindowVP (Exists, "Caption=提示", "VP=Window Existence;Wait=1,3") 的结果都是1,奇怪!好象有看不见的窗口存在!
dionysus 2006-11-2 21:10
那就诡异了,建议楼主再查一下代码,我按照楼主的这种判断结构在自己机器上运行没问题。在一个干净的环境里单步运行脚本看看呢
sky2008 2006-11-4 12:15
再次调试:有提示窗口 Result = WindowVP (Exists, "Caption=提示", "VP=Window SetContext;Wait=1,3") 值为0 ??? 是哪里问题??
geniar 2007-5-25 17:50
在Window SetContext, "Caption=计算机;ChildWindow", ""前面加一句
Window ResetTestcontext, "", "" 激活所有的窗口,