seleniumcucumbercapybarascreenshot

Is it possible to take a screenshot of the whole page with Selenium/Capybara?


PhantomJS has the option of taking a screenshot of the whole page (not just the current viewport). Is there any way to do so using Selenium? I am running the Cucumber/Capybara tests headlessly, using the headless gem. I would use PhantomJS, but I've had some other problems with it.


Solution

  • Turns out I've been using the take_screenshot method that was provided by the headless gem, when I could have just used the page.save_screenshot() method, which does exactly what I need. Thank you, Andrey.