Read more

How to accept or deny JavaScript confirmation dialogs in Capybara/Selenium

Dominik Schöler
September 05, 2011Software engineer at makandra GmbH

These methods are available to you:

page.driver.browser.switch_to.alert.accept
page.driver.browser.switch_to.alert.dismiss
page.driver.browser.switch_to.alert.text # the confirmation text
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Spreewald Show archive.org snapshot gives you steps like these:

When I confirm the browser dialog
When I cancel the browser dialog

Also see Type text into Javascript prompt dialogs in Capybara/Selenium.

Posted by Dominik Schöler to makandra dev (2011-09-05 16:43)