[ 本帖最后由 spqr_tristan 于 2007-8-5 01:27 编辑 ]作者: haiquan180 时间: 2008-2-3 10:57
能不能把解决的方法贴出来 让大家学习学习作者: cjq_999 时间: 2008-7-3 13:30
弹出的 MsgBox 框框无外乎几个属性:"Prompt", vbYesNo, "Title", HelpFile
提示信息存储在"Prompt"中, 你进watir里面搜索 Prompt方面的信息,看能不能获得这些信息。作者: cjq_999 时间: 2008-7-3 13:33
调用新线程处理警告窗口倒已解决?
能不能教我啊?
下面有一段代码是线程解决弹出窗口的,但是我调用不通,你能改进,或者把你那个发给我么?谢谢
def check_for_popups
autoit = WIN32OLE.new('AutoItX3.Control')
# Do forever - assumes popups could occur anywhere/anytime in your application.
loop do
# Look for window with given title. Give up after 1 second.
ret = autoit.WinWait("Microsoft Internet Explorer", '', 1)
#
# If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}).
if (ret==1) then autoit.Send('{enter}') end
#
# Take a rest to avoid chewing up cycles and give another thread a go.
# Then resume the loop.
sleep(3)
end
end
$popup = Thread.new { check_for_popups } # start popup handler
at_exit { Thread.kill($popup) }