Created
October 13, 2012 01:04
-
-
Save bbugh/3882746 to your computer and use it in GitHub Desktop.
Accessing alert box in JavaScript with Capybara/rails/rspec
This file contains hidden or 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
//Get a reference to the alert using the following: | |
alert = page.driver.browser.switch_to.alert | |
// and then hit OK with | |
page.driver.browser.switch_to.alert.accept | |
// or dismiss it with | |
page.driver.browser.switch_to.alert.dismiss | |
// or get the text with | |
page.driver.browser.switch_to.alert.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works for me