我正在尝试在 watir 3.0 的 javascript 对话框中单击确定。我已经尽可能地简化了代码:
@ie.button(:id, "Associate Control Activity").click_no_wait
@ie.clickprompt
def clickprompt(btn="OK", txt="")
sleep 1 until javascript_dialog.exists?
#sleep 1 until javascript_dialog.button(btn).exists? #tried both
javascript_dialog.button(btn).click
end
我经常得到这个,一些脚本比其他脚本多(非常断断续续):
C:/ruby/lib/ruby/gems/1.8/gems/rautomation-0.7.2/lib/rautomation/adapter/win_32/functions.rb:317: [BUG] Segmentation fault
ruby 1.8.7 (2012-06-29 patchlevel 370) [i386-mingw32]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
操作系统是 Win XP sp3。我经常调用clickpompt,一些脚本重复使用它,但它并不总是在我第四次调用它时失败,有时是第二次等等。我需要做一些不同的事情吗?谢谢