marathon-core/ruby-selenium-webdriver/src/main/resources/gems/selenium-webdriver-3.6.0/lib/selenium/webdriver/common/driver_extensions/takes_screenshot.rb
#
# Save a PNG screenshot to the given path
#
# @api public
#
Save a PNG screenshot to the given path
Save a PNG screenshot to the given path
def save_screenshot(png_path)
          extension = File.extname(png_path).downcase
          if extension != '.png'
            WebDriver.logger.warn "name used for saved screenshot does not match file type. "\
                                  "It should end with .png extension"
          end
          File.open(png_path, 'wb') { |f| f << screenshot_as(:png) }
        end
def save_screenshot ( png_path ) extension = File . extname ( png_path ) . downcase if extension != '.png' WebDriver . logger . warn "name used for saved screenshot does not match file type. " "It should end with .png extension" end File . open ( png_path , 'wb' ) { | f | f << screenshot_as ( :png ) } end
Save a PNG screenshot to the given path
Save a PNG screenshot to the given path
png_path
api
None