Sha256: 8b2ebe7ca0982c3edef6c05d4add543f543c8ba0fe90bb9adf55f7328d2a44ec
Contents?: true
Size: 629 Bytes
Versions: 12
Compression:
Stored size: 629 Bytes
Contents
module Selenium module WebDriver module DriverExtensions module TakesScreenshot def save_screenshot(png_path) File.open(png_path, 'w') { |f| f << screenshot_as(:png) } end def screenshot_as(format) case format when :base64 bridge.getScreenshotAsBase64 when :png bridge.getScreenshotAsBase64.unpack("m")[0] else raise Error::UnsupportedOperationError, "unsupported format: #{format.inspect}" end end end # TakesScreenshot end # DriverExtensions end # WebDriver end # Selenium
Version data entries
12 entries across 12 versions & 2 rubygems