Before using selenium 2.4.0 I had the following code working:
alert = page.driver.browser.switch_to.alert
if alert.text
....
end
Selenium 2.4.0 contains the change "* Raise in switch_to.alert when no alert is present.", so I get a No alert is present (Selenium::WebDriver::Error::NoAlertOpenError)
exception.
How can I check for the presence of an alert with selenium-web-driver 2.4.0?