If you can get hold of the underlying driver from selenium-webdriver,
you can use this API to get nice screenshots (i.e. the full page):
driver.screenshot_as(:base64) => String
The interface is documented here:
This is admittedly not quite an answer to your question, but I'd like
to suggest that in many cases, the save_page (or save_and_open_page)
method will be good enough (though it will of course only save the
current state of the page in HTML, not take an actual screenshot).
Nice. As it turns out, the Selenium driver can be accessed at
page.driver.browser, so you could write:
(Just tested this, and it works great.) Thanks for the tip!
I found one more solution.. May be it will be usefully for someone
File.open("path/to/file.png", 'wb') do |f|