Posted over 10 years ago. Visible to the public. Linked content.

Prevent the selenium webbrowser window from closing after a failed @javascript step

When cucumber encounters a failing step in a @javascript feature, the selenium browser window instantly closes. Sometimes you do not want that, because you need to see what is going on. You can click through the data your feature created, when you add the following file to your features/support directory:

#features/support/examiners.rb After('@leave_the_window_open') do |scenario| if scenario.respond_to?(:status) && scenario.status == :failed print "Step Failed. Press return to close browser" STDIN.getc end end

Does your version of Ruby on Rails still receive security updates?
Rails LTS provides security patches for unsupported versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2).

Owner of this card:

Christoph Beck
Last edit:
over 10 years ago
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Christoph Beck to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more