# File common/src/rb/lib/selenium/webdriver/driver_extensions/takes_screenshot.rb, line 11 def save_screenshot(png_path) File.open(png_path, 'w') { |f| f << screenshot_as(:png) } end
# File common/src/rb/lib/selenium/webdriver/driver_extensions/takes_screenshot.rb, line 15 def screenshot_as(format) case format when :base64 bridge.getScreenshot when :png bridge.getScreenshot.unpack("m")[0] else raise Error::UnsupportedOperationError, "unsupported format: #{format.inspect}" end end
Generated with the Darkfish Rdoc Generator 2.