DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk4 min

How to Wait for a Page to Load in Selenium WebDriver

Selenium’s navigation wait reaches a document readiness threshold, not necessarily the state your test needs. Use an explicit wait for the element or condition required next.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Selenium’s normal page-load strategy already waits for the document to reach readyState complete. That does not mean a JavaScript-driven page has finished rendering the content your test needs. After navigation, wait explicitly for the relevant condition—such as an element becoming visible—before interacting with it. [Selenium Waiting Strategies]

What “page loaded” means in WebDriver

There are two different milestones: the browser document reaches a navigation readiness threshold, and the application reaches the state required by the next test step. WebDriver’s page-load strategy controls the first. It does not promise that a single-page application has finished fetching data, rendering a component, or enabling a control. For that, wait for an application-specific condition. [Selenium Browser Options]

As an Amazon Associate I earn from qualifying purchases.

Wait for the condition your test needs

In Python, use WebDriverWait with a condition such as visibility. The two-second timeout below follows the shape of Selenium’s documentation example; it is illustrative, not a recommended universal timeout. Set a limit suitable for your application and test environment. [Waiting Strategies] [Waiting with Expected Conditions]

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.
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

 driver = webdriver.Chrome()
try:
    driver.get("https://example.com")
    result = WebDriverWait(driver, 10).until(
        EC.visibility_of_element_located((By.ID, "results"))
    )
    result.click()
finally:
    driver.quit()

Replace the URL and locator with the page and element your test actually uses. The explicit wait polls for the condition until it succeeds or the timeout expires; if the condition never becomes true, the wait fails instead of silently proceeding.

Choose a meaningful condition

  • Element exists: use when the next step only requires it to be present in the DOM.
  • Element is visible: use before interacting with content that must be displayed.
  • Application state: when the page exposes a meaningful state or marker, wait for that rather than guessing how long rendering takes.

Selenium documents explicit waits and expected conditions for expressing these checks. [Expected Conditions]

Understand the three page-load strategies

The page-load strategy sets how long a navigation command blocks based on document readiness. It is separate from an explicit wait for a later application state. Selenium documents these strategies in its browser options guidance. [Browser Options]

Strategy Navigation waits for What it means for your test
normal readyState complete The default threshold; other page behavior can still continue afterward.
eager readyState interactive Navigation can return while other resources are still loading.
none No ready-state threshold WebDriver does not block navigation on document readiness.

Using eager or none may let a test move on without waiting for assets it does not need. Neither makes dynamic application content ready by itself: follow navigation with a condition-based wait where the next action depends on the page state.

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

Keep the timeout types separate

These timeouts control different operations. The Selenium Browser Options documentation lists the following defaults for a new WebDriver session; they are documented defaults, not guarantees for every future Selenium or WebDriver revision. [Browser Options]

Timeout Controls Documented default
Page-load timeout How long navigation waits for the configured page-load strategy. 300,000 ms
Implicit wait How long element-location calls wait when an element is not found. 0 ms
Script timeout How long asynchronous script execution may take. 30,000 ms

An implicit wait affects element lookups globally; it does not wait for visibility or for a broader application condition. Selenium warns: “Do not mix implicit and explicit waits.” Combining them can produce unpredictable wait durations. [Waiting Strategies]

Why a fixed sleep is usually the wrong wait

A fixed sleep pauses for a predetermined duration rather than checking whether the needed condition is true. If the page becomes ready sooner, the test wastes time; if it takes longer, the test can still continue too early. Prefer a condition-based explicit wait when the next action depends on a particular element or state. [Waiting Strategies]

Troubleshoot waits that time out or act too early

  • Navigation returns but the target is absent: document readiness is not application readiness. Add an explicit wait for the element or state the next step needs.
  • The wait times out although the element appears later: check that the locator matches the current page, that the expected state can occur, and that the chosen timeout suits the test environment.
  • The element is found but cannot be used: presence alone may not mean it is visible. Wait for visibility when the interaction requires a displayed element.
  • Wait duration is unexpectedly long or inconsistent: inspect whether implicit and explicit waits are both configured. Selenium advises against mixing them.
  • Navigation itself stalls: review the page-load strategy and page-load timeout separately from element waits. A navigation timeout is not the same as an explicit-wait timeout.

Or skip the browser setup

If your goal is a screenshot rather than a Selenium interaction test, ScreenshotNeo can return an image or PDF from one GET request. It is not a replacement for WebDriver when a test must interact with a page. Before capture it accepts cookie/consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for AI agents. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000. See the ScreenshotNeo API documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

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

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

Frequently Asked Questions

Does WebDriverWait wait for the page itself?

It waits for the condition you provide, such as an element becoming visible; it does not replace the navigation readiness strategy.

Should I use an implicit wait or an explicit wait for a dynamic page?

Use an explicit wait when you need a particular application condition, and avoid mixing it with an implicit wait.

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.

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

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
Windows Errors? Fix Them Before They SpreadFree repair scan
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.