Save screenshot with Watir
I am using Watir with Ruby on Rails. I need to save screenshots of couple of pages using Watir. I have managed to get the page that I want to open to show in a browser, but cannot save the screenshot yet. Here's my code: @browser = Watir::Safari.new folios_screenshot_path = Rails.root.join('screenshots/') @page = Page.find(5) cur_url = root_url + 'pages/' + @page.id.to_s @browser.goto cur_url @browser.div(:id => "page").wait_until_present @browser.driver.save_screenshot(pagess_screenshot_path + '/' + @page.id.to_s + '.png') @browser.close In the page that I load, there's a div element with id