Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Use driver.save_screenshot("screenshot.png") when you mean the browser window’s current visible viewport. If you mean every document section below the fold, use Firefox’s Python-only driver.save_full_page_screenshot("full_page.png"). Maximizing or entering operating-system fullscreen changes window geometry; it does not capture the entire page.

This distinction prevents the most common Selenium screenshot mistake: choosing a window-management command when the requirement is actually a full-document image.

Choose the screenshot scope first

“Full browser window” can describe two different outputs:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Current window (viewport): the content currently visible in the browser’s browsing context. Selenium’s normal screenshot command captures this window as a PNG.
  • Full document (full page): the page from the top through content below the visible viewport. Selenium’s Python Firefox API exposes a separate method for this scope.

A browser window also has operating-system chrome such as tabs, the address bar and toolbars. WebDriver screenshot methods capture the web content in the current browsing context, not a desktop image of those native controls. If you need a desktop-level image, Selenium is the wrong layer; use an operating-system capture utility instead.

Capture the current browser window in Python

The standard recipe is to navigate, wait for the application state your test needs, and save the current window:

from selenium import webdriver

with webdriver.Chrome() as driver:
    driver.get("https://example.com")
    driver.save_screenshot("screenshot.png")

The call writes a PNG file and returns a success value according to the Python binding. The image represents the current browsing context at the moment Selenium requests the screenshot. It does not automatically scroll through the document or wait for every animation, lazy-loaded image or asynchronous request to settle.

Save with the alternate file method

Python’s Chromium API also provides get_screenshot_as_file():

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
ok = driver.get_screenshot_as_file("screenshot.png")
if not ok:
    raise OSError("Selenium could not write the screenshot file")

Use either file method; do not call both unless you intentionally need two files. A path ending in .png is the appropriate choice for these documented methods.

Keep the image in memory

For an upload, assertion or API response, avoid an intermediate file:

png_bytes = driver.get_screenshot_as_png()
base64_png = driver.get_screenshot_as_base64()

The first value is PNG bytes. The second is a Base64-encoded string. Both represent the current window rather than a full document.

Capture the entire document with Firefox

When the requirement is content below the fold, use the Firefox Python API:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
from selenium import webdriver

with webdriver.Firefox() as driver:
    driver.get("https://example.com")
    driver.save_full_page_screenshot("full_page.png")

save_full_page_screenshot() is documented for Selenium’s Python Firefox driver and saves a full-document PNG. Its companion, get_full_page_screenshot_as_file(), reports a boolean result: True when the operation succeeds and False on an I/O error.

from selenium import webdriver

with webdriver.Firefox() as driver:
    driver.get("https://example.com")
    ok = driver.get_full_page_screenshot_as_file("full_page.png")
    if not ok:
        raise OSError("The full-page screenshot was not written")

Keep the scope qualification attached to this advice: the documented full-document method here is the Firefox Python API. Do not assume that the same method, behavior or compatibility exists for Chromium, another language binding, a remote provider or every headless configuration without checking that exact driver’s documentation.

Maximize versus fullscreen: what these commands actually do

Window-management commands alter the browser’s geometry; they are not full-page screenshot commands.

driver.maximize_window()       # enlarge the browser window
viewport_path = "viewport.png"
driver.save_screenshot(viewport_path)

driver.fullscreen_window()     # window-manager fullscreen, similar to F11
driver.save_screenshot("fullscreen_viewport.png")

maximize_window()

Maximizing asks the window manager to enlarge the current browser window. The resulting viewport size depends on the operating system, display and window-manager rules. It can change responsive breakpoints and therefore the layout captured by the next screenshot.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

fullscreen_window()

Fullscreen is a window-manager operation comparable to pressing F11 in most browsers. It fills the display area available to the browser, but it still captures the current viewport. It does not scroll or stitch the document into one image.

If reproducible pixel dimensions matter, set an explicit window or viewport size in your test environment rather than relying on maximize or fullscreen. These operations do not promise the same pixel dimensions across operating systems, displays, browser versions or remote sessions.

A reliable capture sequence

Screenshot timing is part of test design. Selenium’s screenshot API captures the state that exists when the command runs; the reviewed API references do not promise that animations, lazy images or application requests have finished. Build readiness into your own flow.

  1. Create the driver. Select the browser whose screenshot scope you need. Use Firefox Python when you require the documented full-document method.
  2. Navigate. Call driver.get(url) and confirm that navigation has reached the expected page.
  3. Wait for application state. Use an explicit wait for a meaningful element or state in your application. A fixed delay can be useful for a known transition, but it is less precise than waiting for the condition your page actually exposes.
  4. Set geometry if needed. Maximize, fullscreen or configure a known viewport before capture. Record that geometry when comparing images.
  5. Capture once. Choose save_screenshot() for the visible window or Firefox’s save_full_page_screenshot() for the full document.
  6. Check the result. Verify the returned boolean where the file method provides one and confirm that the expected file exists and has non-zero size.

Example with an explicit readiness wait

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

with webdriver.Chrome() as driver:
    driver.get("https://example.com")
    WebDriverWait(driver, 20).until(
        EC.visibility_of_element_located((By.TAG_NAME, "body"))
    )
    driver.save_screenshot("ready-viewport.png")

Replace the example condition with an element that proves your own application is ready. A visible body only demonstrates that a document exists; it does not prove that a chart, image, login state or API-fed component has finished rendering.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Method comparison

Need Python method Output and scope
Save the visible current window driver.save_screenshot(path) PNG of the current browsing context
Save the visible current window (alternate) driver.get_screenshot_as_file(path) PNG file; reports success status
Get visible-window bytes driver.get_screenshot_as_png() PNG bytes in memory
Get visible-window Base64 driver.get_screenshot_as_base64() Base64 string
Save the full document driver.save_full_page_screenshot(path) Firefox Python API; full-document PNG
Save the full document (alternate) driver.get_full_page_screenshot_as_file(path) Firefox Python API; boolean success result
Enlarge the window driver.maximize_window() Window geometry only
Use display fullscreen driver.fullscreen_window() Window-manager fullscreen; viewport capture still required

Troubleshooting common failures

The image stops at the fold

You used save_screenshot(), which is a current-window capture. For a full document, run the Firefox Python method and save to a PNG path. If your project uses another browser or binding, verify whether that exact combination documents full-page support rather than substituting a generic claim.

Fullscreen did not include the whole page

fullscreen_window() changes window-manager state. It does not capture below the viewport. Use save_screenshot() for the newly enlarged viewport or the documented Firefox full-page method for the document.

The screenshot is blank or incomplete

Capture may have occurred before the page reached the state you intended. Wait for a page-specific element, check that navigation succeeded, and account for transitions or content loaded after the initial document. Also verify that the driver session is still active and that the destination directory is writable.

Lazy images or dynamic widgets are missing

Selenium does not promise that those resources are ready when a screenshot command is called. Wait for the relevant image or widget state in your application, and design the page or test so that asynchronous work has a detectable completion condition.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The file method reports failure

For the documented file APIs, inspect the boolean result. A false result can indicate an I/O problem: check the path, permissions, directory existence and available storage. Use an absolute path while diagnosing so the process’s working directory cannot cause confusion.

Images differ between machines

Window size, display scaling, browser version, operating-system font rendering, device-pixel ratio and responsive breakpoints can all affect pixels. Maximize and fullscreen are not fixed-size contracts. Standardize the driver environment and explicit viewport settings when image comparison is important.

A remote or headless run behaves differently

The reviewed Selenium references do not establish a complete compatibility matrix for every browser, version, headless mode or remote session. Treat behavior as driver- and binding-specific, confirm the exact combination in its official documentation, and keep a small smoke test that records the produced dimensions and file result.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and storage considerations

A viewport PNG is generally smaller and faster to process than a long full-document image, while a full-page capture can become large for very tall documents. Choose the narrowest scope that answers the test or reporting question. Use deterministic filenames that include a test name, viewport or timestamp, and clean them up in CI so artifacts do not consume unbounded storage.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For visual regression, capture after the same readiness condition, viewport and browser configuration every time. Do not treat a passing file write as proof that the page content is correct: a valid PNG can still contain an error page or an incomplete application state. Pair screenshot assertions with navigation and element checks.

Or skip the browser setup

ScreenshotNeo provides a one-request website screenshot API when you do not need to maintain a Selenium browser session. It accepts consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients.

For a direct request, see the ScreenshotNeo documentation:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

The same call in Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
    timeout=90,
)
r.raise_for_status()
open("shot.webp", "wb").write(r.content)

And in Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = Buffer.from(await res.arrayBuffer());
require('fs').writeFileSync('shot.webp', data);

ScreenshotNeo has 63 capture options, including full-page lazy-image loading, CSS-selector element capture, device presets and custom viewports, retina scale, PDF settings, custom CSS and JavaScript, clicks, waits, blocking controls, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, selectable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Parameter names used by other screenshot APIs also work for easier migration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Every feature is included on every plan: 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000 screenshots. Yearly billing provides two months free. Create a free ScreenshotNeo account to try the 1,000 monthly screenshots without a card.

Frequently Asked Questions

Does Selenium capture the browser tabs and address bar?

No. WebDriver screenshots capture web content in the current browsing context, not native browser chrome or the whole desktop.

Which method should I use for a screenshot assertion?

Use the method matching the assertion’s scope: save_screenshot() for the visible viewport, or Firefox Python’s save_full_page_screenshot() for a documented full-document PNG.

Is Firefox full-page capture guaranteed in every Selenium setup?

The documented method is specific to Selenium’s Python Firefox API. Confirm support for any other browser, binding, version, headless mode or remote configuration you plan to run.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.