使模式对话框脚本适应Firefox
|
我正在调整我的回归测试以在firefox中测试Web应用程序。最大的绊脚石似乎是如何在Firefox中自动化模式对话框。
在ie中,我使用以下脚本的变体,但在Firefox中不起作用。是否有其他方法可以同时在ie和firefox中使用?
popup=Thread.new {
autoit=WIN32OLE.new(\'AutoItX3.Control\')
ret=autoit.WinWait(title,\"\",60)
if (ret==1)
puts \"There is popup.\"
autoit.WinActivate(title)
button.downcase!
if button.eql?(\"ok\") || button.eql?(\"yes\") || button.eql?(\"continue\")
autoit.Send(\"{Enter}\")
else
autoit.Send(\"{tab}\")
autoit.Send(\"{Enter}\")
end
elsif (ret==0)
puts \"No popup, please check your code.\"
end
}
at_exit { Thread.kill(popup) }
end
button.click_no_wait
check_for_popups(\"Message from webpage\", \"OK\")
没有找到相关结果
已邀请:
2 个回复
瞧叮
桔适丛