title: Save screenshot with Watir
body: <p>I am using Watir with Ruby on Rails.</p>
  
  <p>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:</p>
  
  <pre><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 =&gt; "page").wait_until_present
  @browser.driver.save_screenshot(pagess_screenshot_path + '/' + @page.id.to_s + '.png')
  @browser.close
  </code></pre>
  
  <p>In the page that I load, there's a div element with id 'page', and I am trying to make Watir wait till that element is loaded in the Watir browser. But in my main browser, I get the error <strong>Unable to load page within 10 seconds</strong>, and the screenshot doesn't get saved either. Any idea on what's wrong?</p>