FirefoxでWebアプリをテストするために回帰テストを適応させています。最大の障害は、Firefoxのモーダルダイアログを自動化する方法のようです。
つまり、以下のスクリプトのバリエーションを使用しますが、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")