I tried to do this, but Capybara does not support it. Capybara ships with Selenium 2.0, not Selenium RC (as indicated in the page ), which is a library that supports this method.
Using it with Cucumber outside of Capybara involves loading and initializing the selenium-client driver. I assume that you use it in the context of Rails, so setting up the environment will be required, I'm not sure how much this works, but I would say that it is not worth the hassle.
If you are concerned about the alerts generated by link_to ...: confirm => "Are you sure?" and similar ones, don't worry, Cucumber provides a good workaround for those who have pseudo-js emulation.
source
share