Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk6 min

How to Measure Page Load Time with Selenium

Learn what Selenium’s navigation timer actually measures, how to read browser navigation milestones, and how to time the moment a dynamic app is usable.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To measure a Selenium navigation, take a monotonic-clock reading immediately before driver.get(url) and another as soon as it returns. The difference is the WebDriver navigation-call duration under the browser’s configured page-load strategy—not a universal measure of when every part of a modern page is ready.

Choose what “page load time” means

There are several useful measurements, and they answer different questions. Decide which one you need before comparing results or setting a performance target.

As an Amazon Associate I earn from qualifying purchases.

Method What it measures Best use Main caveat
Monotonic clock around driver.get() Elapsed time for the WebDriver navigation call under the selected page-load strategy A simple, repeatable end-to-end navigation measurement Includes WebDriver/browser coordination; its meaning changes with the strategy
Navigation Timing API Browser timestamps for the current document navigation Inspecting specific browser-reported navigation milestones Does not automatically measure later application readiness
Explicit wait for an application condition Time until a chosen element or state is usable Measuring readiness for a user workflow on a dynamic page The condition must represent the outcome users need
ChromeDriver performance logs or tracing Browser Timeline, Network and Page events, plus trace data when enabled Diagnosing what contributed to a slow run Must be enabled; tracing adds overhead and its buffer can fill
Chrome DevTools Performance recording CPU and runtime profile data Investigating bottlenecks after a slow result A diagnostic profile, not a single page-load score

Measure the WebDriver navigation call

Use a monotonic clock, which is designed to measure elapsed durations and is not subject to wall-clock adjustments. In Python, time.perf_counter() is suitable. Start immediately before navigation and stop immediately after driver.get() returns.

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

Selenium’s default normal page-load strategy waits for the document’s load event, corresponding to the complete ready state. Selenium also offers eager, which waits for interactive / DOMContentLoaded, and none, which does not block on page load. Because changing this setting changes what the interval represents, record the strategy alongside every result. See Selenium’s browser options documentation.

Runnable Python example

Install Selenium with python -m pip install selenium. The example uses Selenium Manager to obtain a compatible browser driver where supported by the installed Selenium setup. It prints the configured strategy and elapsed milliseconds.

import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

url = "https://example.com"
options = Options()
# The default is "normal". Set explicitly so the result is easy to interpret.
options.page_load_strategy = "normal"  # "normal", "eager", or "none"

driver = webdriver.Chrome(options=options)
try:
    start = time.perf_counter()
    driver.get(url)
    elapsed_ms = (time.perf_counter() - start) * 1000

    print(f"strategy={options.page_load_strategy}")
    print(f"webdriver_navigation_ms={elapsed_ms:.2f}")
    print(f"document_ready_state={driver.execute_script('return document.readyState')}")
finally:
    driver.quit()

The printed duration is the time spent in the WebDriver navigation call, not only network transfer or browser rendering. The ready-state value is a useful snapshot, but it is not proof that later JavaScript-driven updates have finished.

Run repeatable measurements

A single run can be affected by browser startup, cache state, network variation, server response, and machine load. For useful comparisons, keep the browser version, machine or runner, network conditions, URL, page-load strategy, and cache policy consistent. Separate browser startup from the navigation interval if startup is not part of the question. Run multiple trials and report the distribution or at least the individual observations and median; do not present one run as a stable site-wide performance figure. No universal “good” threshold follows from the Selenium timing method alone.

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.

Read browser navigation milestones with Navigation Timing

To inspect browser-reported timing for the current document, query the Navigation Timing entry through the Performance API after navigation. Choose and label the interval precisely; these browser timestamps are not interchangeable with the wall-clock duration around driver.get(). See MDN’s Navigation Timing documentation.

timing = driver.execute_script("""
const entry = performance.getEntriesByType('navigation')[0];
if (!entry) return null;
return {
  type: entry.type,
  startToResponseStartMs: entry.responseStart - entry.startTime,
  responseStartToResponseEndMs: entry.responseEnd - entry.responseStart,
  domContentLoadedMs: entry.domContentLoadedEventEnd - entry.startTime,
  loadEventMs: entry.loadEventEnd - entry.startTime
};
""")
print(timing)

These fields express browser timing milestones for the current document navigation. For example, loadEventMs is an interval from the navigation entry’s start to the load event end; it is not an application-specific “ready” time. If there is no navigation entry, handle the returned None rather than assuming a timing value exists.

Measure readiness for a dynamic application

A document reaching complete does not guarantee that a single-page application has finished fetching data, rendering a result, or enabling a control. Selenium explicitly warns that JavaScript may load content after the ready state has returned complete. For a user-facing workflow, start the timer before navigation and stop it when the condition that matters is met, such as a result becoming visible or a loading indicator disappearing. Selenium’s navigation commands wait according to the page-load strategy, while dynamic content can otherwise cause race conditions and flaky tests; see Selenium’s waiting strategies.

Example: wait for a usable element

import time
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

url = "https://example.com/search"
driver = webdriver.Chrome()
try:
    start = time.perf_counter()
    driver.get(url)
    result = WebDriverWait(driver, 15).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, "[data-testid='search-results']"))
    )
    app_ready_ms = (time.perf_counter() - start) * 1000
    print(f"app_ready_ms={app_ready_ms:.2f}")
finally:
    driver.quit()

Replace the selector with a stable condition tied to the workflow being measured. A visible results container may be suitable for a search result page; for another workflow, the appropriate signal could be a button becoming enabled or a loading indicator disappearing. The timeout is a failure bound, not a target duration. If the condition never becomes true, Selenium raises a timeout instead of yielding a readiness measurement.

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

Diagnose slow runs without confusing diagnosis with timing

ChromeDriver performance logs and tracing

ChromeDriver can collect Timeline, Network, and Page events when performance logging is enabled for the new session; it is not enabled by default. Use logs and tracing to investigate contributors, not as a substitute for the lightweight navigation duration. Tracing adds overhead, and its buffer can fill, so inspect for warnings or missing events and keep diagnostic runs distinct from benchmark runs. See ChromeDriver performance logging.

Chrome DevTools Performance panel

After a slow result, a recording in the Performance panel can help identify CPU and runtime bottlenecks. Treat the profile as diagnostic evidence about what the browser did, not as the Selenium navigation duration. See Chrome DevTools Performance panel documentation.

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

Common measurement problems

  • The number changes when you switch strategies: expected—the strategy controls when navigation returns. Report it with the result and do not compare unlike strategies as if they measured the same endpoint.
  • The page looks unfinished although driver.get() returned: wait for a meaningful application condition; document readiness does not cover every later JavaScript update.
  • The explicit wait times out: verify the selector and expected state in the page, check whether the condition is actually reached, and choose a timeout appropriate to the test. Do not treat the timeout value as the measured load time.
  • No Navigation Timing entry is returned: query after navigating the intended document and check that the page context is the one expected. Handle a missing entry rather than calculating from absent data.
  • Performance logs are absent: enable performance logging when creating the browser session; the feature is not on by default.
  • Tracing produces warnings or incomplete events: tracing can add overhead and fill its buffer. Reduce or separate diagnostic capture and inspect the warnings before drawing conclusions.
  • Results vary between runs: control browser, runner, cache, network, and workload conditions, then repeat and report the variation rather than relying on one sample.

Or skip the browser setup

If the goal is a screenshot rather than a Selenium timing test, ScreenshotNeo can return an image or PDF with one GET request. Its screenshot result is not a replacement for Selenium navigation timing or an application-readiness measurement.

Install Python’s requests package, create an API key, then use the request shown in the ScreenshotNeo documentation:

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.
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
  • Cookie/consent banners are accepted like a visitor and removed along with 60+ known consent platforms, newsletter popups, and chat widgets; each cleanup step can be turned off.
  • Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing; response headers identify the page verdict and whether the request was billed.
  • An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
  • The free plan includes 1,000 shots per month without a card; paid plans start at $5 for 3,000 shots.

Sign up for 1,000 free screenshots a month, with no card required.

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.

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.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair 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.