Method: Capybara::Session#save_screenshot

Defined in:
lib/capybara/session.rb

#save_screenshot(path = nil, **options) ⇒ String

Save a screenshot of page.

If invoked without arguments it will save file to save_path and file will be given randomly generated filename. If invoked with a relative path the path will be relative to save_path.



747
748
749
# File 'lib/capybara/session.rb', line 747

def save_screenshot(path = nil, **options)
  prepare_path(path, 'png').tap { |p_path| driver.save_screenshot(p_path, **options) }
end