Created
April 10, 2015 17:03
-
-
Save titusfortner/653ab5bb8a901ba3b41b to your computer and use it in GitHub Desktop.
Escape Alerts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ensure_no_alert | |
@alert.accept if alert? | |
end | |
def alert? | |
@alert = @driver.switch_to.alert | |
true | |
rescue Selenium::WebDriver::Error::NoAlertPresentError | |
false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment