ysngug
Last Updated: February 07, 2017
·
11.28K
· dsci
32b6de7d5abfe436f9b7e86c50f73eae

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:

save_and_open_page

For the last solution launchy is required:

group :test do
   gem 'launchy'
end
Say Thanks
Respond

1 Response
Add your response

28578

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

9 months ago ·