Last Updated: February 07, 2017
· dsci

Print the current page's html source in Capybara

To get the HTML source of Cucumbers current location there are several ways:

To get the whole HTML source in STDOUT:

print page.html

To get the HTML body in STDOUT:

print bage.body

To get the current location in the browser:


For the last solution launchy is required:

group :test do
   gem 'launchy'

1 Response
Add your response

Nice write-up! I think you have a typo, though... print bage.body should be print page.body

over 1 year ago ·