If one is present, is there a simple way to print the text and/or title of a modal dialog?
puts $browser.modal_dialog.text
undefined method `modal_dialog' for #<Watir::Browser:0xa7335d4>
gem list
watir-webdriver (0.6.1)
What I have to run often in my code due to difficult-to-predict blocking popups:
(puts "$browser.modal_dialog.text would be nice here..."; $browser.driver.switch_to.alert.dismiss) rescue (puts __LINE__.to_s + ": #{$!}"; ) # No alert is present 1282: Modal dialog present
Assuming we are talking about a javascript alert window, the following will get you the text.
I did not have any luck with getting the title.