{"record":{"id":"725daf0f30a5aa77","repo":"SeleniumHQ/selenium","slug":"full-page-screenshots-are-not-supported-for-insp","errorCode":null,"errorMessage":"Full Page Screenshots are not supported for #{inspect}","messagePattern":"Full Page Screenshots are not supported for #(.+?)","errorType":"exception","errorClass":"Error::UnsupportedOperationError","httpStatus":null,"severity":"error","filePath":"rb/lib/selenium/webdriver/common/takes_screenshot.rb","lineNumber":54,"sourceCode":"                                'It should end with .png extension',\n                                id: :screenshot\n        end\n        WebDriver.logger.debug(\"Saving screenshot to #{Dir.pwd}/#{png_path}\", id: :screenshot)\n        File.open(png_path, 'wb') { |f| f << screenshot_as(:png, full_page: full_page) }\n      end\n\n      #\n      # Return a PNG screenshot in the given format as a string\n      #\n      # @param [:base64, :png] format\n      # @param [Boolean] full_page allows taking full page screenshots if supported\n      # @return String screenshot\n      #\n      # @api public\n\n      def screenshot_as(format, full_page: false)\n        if full_page && !respond_to?(:save_full_page_screenshot)\n          raise Error::UnsupportedOperationError, \"Full Page Screenshots are not supported for #{inspect}\"\n        end\n\n        case format\n        when :base64\n          full_page ? full_screenshot : screenshot\n        when :png\n          screenshot_as(:base64, full_page: full_page).unpack1('m')\n        else\n          raise Error::UnsupportedOperationError, \"unsupported format: #{format.inspect}\"\n        end\n      end\n    end # TakesScreenshot\n  end # WebDriver\nend # Selenium\n","sourceCodeStart":36,"sourceCodeEnd":69,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/rb/lib/selenium/webdriver/common/takes_screenshot.rb#L36-L69","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Only pass full_page: true when the driver supports it (currently Firefox).","Check capability before calling: driver.respond_to?(:save_full_page_screenshot) before requesting full_page.","For Chrome full-page screenshots, use the DevTools-based CDP approach or a third-party gem instead.","Fall back to viewport-only screenshots (full_page: false, the default) for unsupported browsers."],"exampleFix":"// before\ndriver.save_screenshot('page.png', full_page: true)  # raises on Chrome\n\n// after (conditional)\nif driver.respond_to?(:save_full_page_screenshot)\n  driver.save_screenshot('page.png', full_page: true)\nelse\n  driver.save_screenshot('page.png')  # viewport only\nend","handlingStrategy":"type-guard","validationCode":"def take_screenshot(driver, path, full_page: false)\n  if full_page && !driver.respond_to?(:save_full_page_screenshot)\n    warn 'Full-page screenshots not supported by this driver; falling back to viewport.'\n    full_page = false\n  end\n  driver.save_screenshot(path, full_page: full_page)\nend","typeGuard":"def supports_full_page_screenshot?(driver)\n  driver.respond_to?(:save_full_page_screenshot)\nend","tryCatchPattern":"begin\n  driver.save_screenshot('page.png', full_page: true)\nrescue Selenium::WebDriver::Error::UnsupportedOperationError => e\n  raise unless e.message.include?('Full Page Screenshots are not supported')\n  warn 'Full-page not supported; taking viewport screenshot instead.'\n  driver.save_screenshot('page.png')\nend","preventionTips":["Check driver.respond_to?(:save_full_page_screenshot) before requesting full_page: true.","Make full_page an opt-in flag, not a default, in cross-browser screenshot utilities.","Document which browsers support full-page screenshots in your test framework."],"tags":["screenshot","full-page","browser-specific","unsupported-operation","ruby"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}