I am looking for a way to save a screenshot of an element of a web page when I run acceptance tests. Is this possible with Capybara or another tool with RSpec/Cucumber tests?
Asked
Active
Viewed 127 times
2 Answers
2
Take a look at phantomjs.
and this question with how to grab only part of the screen.
-
Thanks for the link, but one problem with PhantomJS is that it might not be as up-to-date as the Chrome version I am testing against. Also I ideally want to capture screen shots in multiple browsers: Firefox, Chrome, and Safari. In the future I might add IE 10 and Opera to the list too. – TheFooProgrammer Dec 03 '12 at 14:26
0
Taking a screen shot is very easy with Capybara.
http://www.opinionatedprogrammer.com/2012/01/screenshots-with-capybara-selenium/
However I don't believe there is any current implementation of screenshots that can cherry pick a certain element on the page.

stuartc
- 2,244
- 2
- 24
- 31