SeleniumHQ/selenium · error · Error::UnsupportedOperationError

Full Page Screenshots are not supported for #{inspect}

Error message

Full Page Screenshots are not supported for #{inspect}

What it means

Raised by TakesScreenshot#screenshot_as when full_page: true is passed but the driver/bridge does not implement the save_full_page_screenshot method. Full-page screenshot support is browser-specific: Firefox implements it natively (via Firefox::Driver which includes full_screenshot support), but Chrome/Edge/Safari do not support full-page screenshots through this API.

Source

Thrown at rb/lib/selenium/webdriver/common/takes_screenshot.rb:54

                                'It should end with .png extension',
                                id: :screenshot
        end
        WebDriver.logger.debug("Saving screenshot to #{Dir.pwd}/#{png_path}", id: :screenshot)
        File.open(png_path, 'wb') { |f| f << screenshot_as(:png, full_page: full_page) }
      end

      #
      # Return a PNG screenshot in the given format as a string
      #
      # @param [:base64, :png] format
      # @param [Boolean] full_page allows taking full page screenshots if supported
      # @return String screenshot
      #
      # @api public

      def screenshot_as(format, full_page: false)
        if full_page && !respond_to?(:save_full_page_screenshot)
          raise Error::UnsupportedOperationError, "Full Page Screenshots are not supported for #{inspect}"
        end

        case format
        when :base64
          full_page ? full_screenshot : screenshot
        when :png
          screenshot_as(:base64, full_page: full_page).unpack1('m')
        else
          raise Error::UnsupportedOperationError, "unsupported format: #{format.inspect}"
        end
      end
    end # TakesScreenshot
  end # WebDriver
end # Selenium

View on GitHub (pinned to aa36b38e69)

Solutions

  1. Only pass full_page: true when the driver supports it (currently Firefox).
  2. Check capability before calling: driver.respond_to?(:save_full_page_screenshot) before requesting full_page.
  3. For Chrome full-page screenshots, use the DevTools-based CDP approach or a third-party gem instead.
  4. Fall back to viewport-only screenshots (full_page: false, the default) for unsupported browsers.

Example fix

// before
driver.save_screenshot('page.png', full_page: true)  # raises on Chrome

// after (conditional)
if driver.respond_to?(:save_full_page_screenshot)
  driver.save_screenshot('page.png', full_page: true)
else
  driver.save_screenshot('page.png')  # viewport only
end
Defensive patterns

Strategy: type-guard

Validate before calling

def take_screenshot(driver, path, full_page: false)
  if full_page && !driver.respond_to?(:save_full_page_screenshot)
    warn 'Full-page screenshots not supported by this driver; falling back to viewport.'
    full_page = false
  end
  driver.save_screenshot(path, full_page: full_page)
end

Type guard

def supports_full_page_screenshot?(driver)
  driver.respond_to?(:save_full_page_screenshot)
end

Try / catch

begin
  driver.save_screenshot('page.png', full_page: true)
rescue Selenium::WebDriver::Error::UnsupportedOperationError => e
  raise unless e.message.include?('Full Page Screenshots are not supported')
  warn 'Full-page not supported; taking viewport screenshot instead.'
  driver.save_screenshot('page.png')
end

Prevention

When it happens

Trigger: Calling driver.save_screenshot('full.png', full_page: true) or driver.screenshot_as(:png, full_page: true) with a Chrome or Edge driver. Passing full_page: true generically in a cross-browser test that runs against non-Firefox browsers. Using a Remote driver connected to a non-Firefox session.

Common situations: Writing a cross-browser screenshot utility with a full_page: true flag, then running it against Chrome. Copying Firefox-specific full-page screenshot code into a Chrome test. Headless Chrome users expecting full-page support (it has a different DevTools-based mechanism, not this API).

Related errors


AI-assisted analysis of SeleniumHQ/selenium@aa36b38e69 (2026-08-14). Data as JSON: /api/errors/725daf0f30a5aa77. Report an issue: GitHub.