Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Firefox

How to Capture a Full-Page Screenshot of a Web App After Login with Selenium

By Freedom251 Team · · 6 min read

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

Log in through the app in a Selenium-controlled browser, wait for a reliable sign that the authenticated page is ready, and capture the page in that same browser session. For a directly documented full-document API, use Selenium’s Python binding with Firefox: generic screenshot calls and browser-specific alternatives do not guarantee a full-page image in every environment.

Use Firefox’s full-page screenshot method in Python

Selenium’s Python API documents full-page screenshot methods for Firefox, including get_full_page_screenshot_as_file(path), save_full_page_screenshot(path), get_full_page_screenshot_as_png(), and get_full_page_screenshot_as_base64(). The example below uses the file method. It signs in through the app’s normal login form, waits for a dashboard heading, then saves a PNG from the same driver session.

As an Amazon Associate I earn from qualifying purchases.

Install Selenium with python -m pip install selenium, and make sure Firefox is installed. Selenium’s current Python API documentation identifies version 4.50.0; check the API documentation and your project’s pinned versions when setting up a different version. Firefox’s Selenium guide was last modified July 29, 2025. Selenium Firefox documentation · Selenium Python API documentation.

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

Runnable example

Set the environment variables to your test account and the app’s actual URLs and dashboard heading. The CSS selectors are examples; replace them with selectors from your application.

#1 Best Overall
HP OmniBook 3 17.3 inch Laptop PC, FHD Display, AMD Ryzen 3 30, 8 GB RAM, 512 GB SSD, AMD Radeon 610M Graphics, Windows 11 Home, Mica Silver, 17-dp0199nr
  • FULL HD IPS DISPLAY - Enjoy vibrant, crystal-clear images with 178-degree wide-viewing angles
  • AMD RYZEN 3 30 PROCESSOR - Everyday performance you can count on; Multitask, stream, game casually, and edit photos smoothly with responsive power and vibrant HDR visuals
  • ENJOY UP TO 14 HOURS AND 15 MINUTES OF BATTERY LIFE - HP Fast Charge restores battery from 0 to 50% in approximately 45 minutes
  • AMD RADEON 610M GRAPHICS - Experience smooth entertainment; Built for streaming and multitasking, enjoy realistic visuals and efficient performance for work and play
  • STORAGE AND MEMORY - 512 GB PCIe NVMe M.2 SSD offers fast speed and efficient storage; and 8 GB LPDDR5 RAM memory boosts performance with higher bandwidth
import os
from pathlib import Path

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

login_url = os.environ["APP_LOGIN_URL"]
username = os.environ["APP_TEST_USERNAME"]
password = os.environ["APP_TEST_PASSWORD"]

output = Path("dashboard-full.png")
driver = webdriver.Firefox()

try:
    driver.get(login_url)
    wait = WebDriverWait(driver, 30)

    wait.until(EC.visibility_of_element_located((By.NAME, "username"))).send_keys(username)
    driver.find_element(By.NAME, "password").send_keys(password)
    driver.find_element(By.CSS_SELECTOR, "button[type='submit']").click()

    # Replace with a heading or other element that only appears after login.
    wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, "h1.dashboard-title")))

    # Optional: wait for application-specific loading UI to disappear.
    wait.until(EC.invisibility_of_element_located((By.CSS_SELECTOR, ".loading-indicator")))

    saved = driver.get_full_page_screenshot_as_file(str(output))
    if not saved:
        raise RuntimeError("Firefox did not report that the screenshot was saved")
    print(f"Saved {output.resolve()}")
finally:
    driver.quit()

The file method returns a success boolean; check it rather than assuming the file exists. Use a .png filename for this method. The example uses explicit waits instead of a fixed sleep because a successful page-load event does not mean a modern app has finished rendering its authenticated content.

Make the capture represent the authenticated page

Prefer the normal login flow

Driving the login form or an application-approved test-authentication flow most closely reproduces the user’s path. Do not capture with a new WebDriver session after login: authentication state belongs to the browser session and context that completed the sign-in.

Rank #2
HP 14" HD Chromebook Laptop for Students, Intel Quad-Core N4120(> N4020), 4GB RAM, 64GB eMMC, WiFi, Webcam, HDMI, USB-A&C, 14 Hours Battery Life, Zoom, Chrome OS, CUE Accessories
  • Intel Celeron N4120: 4 Cores & Threads, 1.1GHz Base Clock, Up to 2.6GHz Boost Clock, 4MB Cache, Intel UHD Graphics 600. The perfect combination of performance, power consumption, and value helps your device handle multitasking smoothly and reliably with four processing cores to divide up the work.

Use cookie injection only when the app supports it

Selenium can add cookies, but cookies alone are not necessarily equivalent to a complete login. An application may also depend on local storage, server-side session state, CSRF state, or identity-provider redirects. Selenium’s cookie documentation explains that cookies are scoped to the current browsing context and that the driver must first visit a domain valid for the cookie. A smaller page on the same site can establish that domain before adding a cookie. Selenium cookie documentation.

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

If your test environment explicitly supports cookie-based authentication, visit the correct domain first, add only a test-safe cookie with the required attributes, then open the protected route and verify a visible authenticated-state signal. Never put a real user’s session secret in source control, logs, or screenshot artifacts.

Rank #3
Sale
AKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops | 7000mAh Battery, IPS FHD, 180°Viewing, Quad-Core Processor, Type-C, WiFi5, Portable Thin Business Student Laptops, Light Gray
  • Stunning 15.6" FHD IPS Display: Experience crisp 1920x1080 resolution on this 15.6 inch laptop with an IPS panel that delivers wide viewing angles and vivid colors. The narrow-bezel design maximizes screen real estate for comfortable viewing on this Win 11 laptop, whether you're studying or working.
  • Celeron J4105 Processor & 256GB SSD: Powered by a reliable Celeron J4105 processor paired with 12GB DDR4 memory and a fast 256GB M.2 SSD. This laptop computer supports SSD expansion up to 2TB and TF card expansion up to 1TB, so your storage grows with your needs. Delivers smooth multitasking for daily productivity.
  • AI-Powered Win 11 Laptop: Built-in AI features enhance your productivity with smart assistance for writing, summarizing, and task management. Pre-installed with Win 11 and includes Office 365 subscription. This student laptop is backed by 1-year warranty and 24/7 customer support.
  • All-Day 7000mAh Battery & 180° Hinge: The high-capacity 7000mAh battery keeps this laptop powered through long classes or meetings. The 180-degree lay-flat hinge lets you share your screen effortlessly during presentations. This durable laptop computer adapts to your dynamic workflow.
  • Versatile Connectivity Hub: Equipped with USB 3.2, Type-C, Mini HDMI, and 3.5mm audio jack to connect all your peripherals. Stay online anywhere with high-speed 5G WiFi and Bluetooth 4.2. This college laptop keeps you connected at home, in the library, or on the go.

Wait for application readiness, not just navigation

driver.get() waits for the page-load event, but client-rendered apps can continue loading afterward. Choose a condition that proves the target view is usable, such as a dashboard heading becoming visible, the expected route loading, a spinner disappearing, or required page content appearing. If the content is lazy-loaded on scroll, scroll through the relevant sections and wait for them to render before capture; a full-page method does not by itself prove the application fetched every deferred item.

Choose an approach for your browser and binding

Environment What Selenium documents Practical implication
Firefox with Python Explicit full-page methods, including file, PNG, and base64 forms, in Selenium’s Python API; the Firefox guide includes a full-page screenshots section. Firefox guide · Python API Best-supported starting point in the cited documentation for a full-document screenshot.
Firefox with Java The HasFullPageScreenshot interface defines a full-page method and identifies FirefoxDriver as an implementing class. The interface is marked Beta. Java interface documentation Confirm availability in the exact Selenium version pinned by your project before relying on it.
JavaScript generic screenshot The WebDriver API describes a best-effort preference order that may include the entire page, current window, visible frame, or display. Selenium JavaScript API Do not assume a generic screenshot command always captures the full document; verify output in the target environment.
Chrome or Chromium using CDP Selenium describes CDP support as temporary until WebDriver BiDi is implemented, says CDP is not designed for testing or stability, and notes that functionality depends heavily on browser versions. Selenium CDP documentation Treat a CDP approach as version-specific. Match Selenium, browser, and DevTools versions, and re-verify after upgrades.

Firefox’s guide notes that, as of Firefox 138, geckodriver needs --allow-system-access to switch to CHROME context. That note concerns privileged browser-chrome context switching; it is not a general requirement for ordinary screenshots of web content.

Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11 | Copilot AI, WiFi 6, Long Battery Life, Lightweight & Portable, Online Learning, Browsing, Streaming, Willow Green
  • Efficient Performance for Everyday Computing: Powered by Intel N150 processor with up to 3.6 GHz Intel Turbo Boost Technology, 6 MB L3 cache, 4 cores, and 4 threads, this HP laptop delivers responsive performance for web browsing, streaming, document editing, and multitasking. Paired with 4GB LPDDR5 RAM and 128GB UFS storage, it handles daily tasks smoothly. Includes 1-year Microsoft 365 Personal subscription for Word, Excel, PowerPoint, and cloud storage to maximize your productivity.
  • 14-Inch HD Micro-Edge Display:Enjoy clear visuals on the 14-inch HD (1366 x 768) anti-glare screen with 250-nit brightness and 62.5% sRGB coverage. The micro-edge bezel delivers a 79% screen-to-body ratio in a compact design. An HP True Vision 720p HD camera with noise reduction and dual-array microphones supports clear video calls, remote work, and online learning.
  • Modern Connectivity and Wireless Technology: Stay connected with Wi-Fi 6 (2x2) for faster wireless speeds and Bluetooth 5.4 for seamless pairing with accessories. Versatile port selection includes 1 USB Type-C 10Gbps with DisplayPort 1.2 for external displays, 2 USB Type-A 5Gbps ports for peripherals, 1 HDMI 1.4b port, 1 headphone/microphone combo jack, and 1 multi-format SD media card reader. Connect monitors, transfer files quickly, and expand your workspace with ease.
  • All-Day Battery Life and Portable Design: Enjoy up to 11 hours of video playback, 7.5 hours of mixed usage, or 7.5 hours of wireless streaming on a single charge, perfect for students and professionals on the go. Weighing just 3.24 lb and measuring 12.76" x 8.86" x 0.71", this lightweight laptop fits easily in backpacks and bags. The stylish willow green top cover with matte finish and natural silver keyboard deck with vertical brushing pattern offer a modern, professional look.
  • AI-Enhanced Productivity: Access Microsoft Copilot instantly with the dedicated Copilot key for faster assistance. AI Noise Reduction filters background sounds and improves voice clarity during calls. Dual speakers provide clear audio, while the full-size natural silver keyboard and HP Imagepad support comfortable typing and navigation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check the screenshot and troubleshoot failures

  • The screenshot shows a login page. The login may have failed, or the capture ran before the redirect or dashboard render completed. Wait for a post-login element or expected route and inspect the page state before saving.
  • The file is missing or the method reports failure. Check that the output directory exists and is writable, the filename ends in .png, and the returned boolean is true. Use an absolute path while diagnosing path issues.
  • Lower sections are blank or incomplete. The app may load them only after scrolling or after an API response. Trigger the app’s normal lazy-loading behavior, wait for the content, then capture and inspect again.
  • The call is unavailable or errors on another browser. Full-page support depends on browser and binding. Use a documented API for the chosen combination rather than assuming a Firefox-specific method works on Chrome or a generic call captures the document.
  • A CDP-based Chrome capture breaks after an upgrade. Re-check compatibility across Selenium, Chrome, and DevTools versions. CDP is version-coupled and Selenium characterizes its support as temporary and unstable.
  • Content is clipped, sticky headers repeat, or the image looks wrong. Inspect the output dimensions and page content in the same target environment. These are reasons to validate the artifact; successful completion of the method alone does not certify visual completeness.

For reliability, keep test credentials outside source code, use explicit waits tied to app state, and retain the screenshot as a test artifact only when it is safe to store. Capture duration and success rate depend on the app, browser, and environment; Selenium’s cited documentation does not establish a general performance figure for this workflow.

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.

Or skip the browser setup

If you need a screenshot API rather than an in-process Selenium capture, ScreenshotNeo takes a URL in one GET request and returns an image or PDF. This is not a substitute for proving a protected page’s authenticated state: provide an authorized URL and any needed authentication details using its supported options. Its clean-shot flow can accept cookie and consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. It also offers an MCP server for AI agents, with take_screenshot, get_page_info, and capture_pdf.

The following cURL example uses the documented API pattern; replace the target URL and provide your API key. See the ScreenshotNeo API documentation for authentication and available parameters.

Best Value
HP Essential Laptop, Intel N150 CPU, 4GB DDR5 RAM, 128GB SSD, Long Battery Life, 1TB Cloud Storage, Win 11 with Microsoft 365
  • 【Powerful Performance】Equipped with Intel N150 CPU, featuring up to 4.4 GHz, ensuring efficient and powerful multitasking capabilities.
  • Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
  • 【Versatile Connectivity】 connected with multiple ports including USB 3.0 Type-C, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
  • One Year Microsoft 365
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Free includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for free.

Frequently Asked Questions

Can Selenium save a full-page screenshot as something other than a file?

Yes. Selenium’s Python Firefox API also documents PNG and base64-returning full-page methods; see the Python API documentation linked above for the exact method names and return forms.

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

Does Firefox 138 require a special flag for a normal full-page web screenshot?

No. The Firefox guide’s --allow-system-access note applies to switching into privileged browser-chrome context, not ordinary content-page capture.

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.

FirefoxPythonscreenshotsSeleniumweb automation

Leave a Reply

Your email address will not be published. Required fields are marked *

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

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.