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.

For a direct navigation, await page.goto(url) waits for the browser’s load event by default. That is often enough to navigate, but it does not guarantee that a modern web app has finished fetching data or displaying the content your test needs. When the next step depends on a particular result, wait for that result with a locator-based assertion instead of treating a generic loading event as proof that the page is ready.

What “finished loading” means in Playwright

A web page does not have one universal point at which every part of it is finished. The browser exposes lifecycle milestones, while an application may continue to request data, render components, or update its interface after those milestones. Choose a wait based on what the next operation actually depends on.

For example, if a test only needs the browser to navigate to a URL, page.goto()’s default is usually suitable. If it needs to click a search result, verify a confirmation message, or use data populated after navigation, wait for that visible state explicitly. The distinction matters because the browser’s load event covers dependent resources such as stylesheets, scripts, iframes, and images, but it is not a promise that all application work has ended.

Choose the right navigation milestone

Pass a waitUntil value to page.goto() when a browser lifecycle milestone is the condition you need. These choices are not interchangeable:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#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
Value What it waits for Use it when
commit The main response has been received and document loading has started. The test needs navigation to begin, but does not yet require the DOM or later resources.
domcontentloaded The document’s DOMContentLoaded event has fired. The DOM is needed and waiting for all dependent resources is unnecessary.
load The document’s load event has fired. This is the default for page.goto(). The next step depends on the browser reaching its load milestone, including dependent resources.
networkidle There have been no network connections for at least 500 ms. Use only when that precise condition is relevant; it is not a general test-readiness signal.

For tests, Playwright discourages relying on networkidle as a readiness detector. A page may continue making background requests, or the network may become quiet before the content your test needs appears. Prefer an assertion about the expected UI state.

Use the simplest reliable pattern

Navigate, then verify the content your test needs

This pattern lets navigation proceed to the default load milestone, then checks that the expected heading is visible. The assertion retries its condition rather than assuming that navigation completion and application readiness are the same thing.

import { test, expect } from '@playwright/test';

test('shows the welcome page', async ({ page }) => {
  await page.goto('https://example.com');
  await expect(page.getByRole('heading', { name: 'Welcome' })).toBeVisible();
});

Replace the example URL and heading with the page and UI state your test actually depends on. A visible, specific locator makes the readiness condition meaningful to a reader of the test as well as to Playwright.

Use an earlier lifecycle milestone when it is sufficient

If the next operation needs the DOM but does not need later dependent resources to finish, request domcontentloaded:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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.
  • 14" HD Display: 14.0-inch diagonal, HD (1366 x 768), micro-edge, anti-glare. See your digital world in a whole new way. Enjoy movies and photos with the great image quality and high-definition detail of 1 million pixels.
  • Memory & Storage: 4 GB LPDDR4x & 64 GB eMMC Storage. Adequate high-bandwidth RAM to smoothly run multiple applications and browser tabs all at once. An embedded multimedia card provides reliable flash-based storage.
  • Ports:2 x USB 3.0 Type-A,1 x USB 3.0 Type-C,1 x HDMI,1 x Headphone Jack
  • Chrome OS: Chromebook is a computer for the way the modern world works, with thousands of apps. Enjoy the seamless simplicity that comes with Google Chrome and Android apps, all integrated into one laptop. It’s fast, simple, and secure.
await page.goto('https://example.com', { waitUntil: 'domcontentloaded' });
await expect(page.getByRole('heading', { name: 'Welcome' })).toBeVisible();

Use commit only when receiving the main response and starting document loading are enough for the next part of your workflow:

await page.goto('https://example.com', { waitUntil: 'commit' });

These earlier milestones can avoid waiting for work the test does not need, but they are not automatic speed improvements: select one only when it matches the dependency of the following step. If the test requires a user-visible result, keep an assertion for that result.

Wait for content rendered asynchronously

When data or UI appears after navigation, wait for the actual content rather than guessing how long the application will take:

await page.goto('https://example.com/search');
await expect(page.getByRole('heading', { name: 'Search results' })).toBeVisible();

Web-first assertions retry until their condition succeeds or the assertion times out. Locator actions also wait for the actionability checks they require. Before a click, Playwright checks that the locator resolves to one element and that it is visible, stable, enabled, and able to receive events. In many cases, that built-in waiting makes a separate generic wait unnecessary.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
AKCHART 15.6'' AI Laptop with Office 365 12GB RAM 256GB SSD Win 11 Laptops
  • 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 the result of an action-triggered navigation

When a click causes navigation, describe the outcome your test cares about. For example, check both the destination URL and a heading on the destination page:

await page.getByRole('link', { name: 'Next page' }).click();
await expect(page).toHaveURL(/next/);
await expect(page.getByRole('heading', { name: 'Next page' })).toBeVisible();

Locator actions already wait for their required actionability conditions. If a particular lifecycle state is specifically needed after the navigation commits, page.waitForLoadState(state) can wait for it. If the document has already reached that state, the call resolves immediately. Playwright notes that this extra lifecycle wait is unnecessary most of the time because actions auto-wait.

Do not build new tests around page.waitForNavigation(): the Page API marks it deprecated and describes it as inherently racy. Use page.waitForURL() when you need to wait for a URL change, or assert the expected URL and destination content as in the example.

Common loading-wait mistakes

  • Treating load as application completion. The event means the browser reached a document lifecycle milestone; asynchronous data and UI updates can follow. Assert the content or state the next action depends on.
  • Using networkidle for every page. Its condition is a 500 ms stretch without network connections, not proof that the right content is visible. Prefer a locator assertion for the expected UI.
  • Adding a fixed sleep. A delay measures elapsed time, not whether a condition became true. A locator or assertion says what the test is waiting for and can proceed as soon as that condition is met.
  • Waiting for a load state before navigation commits. page.waitForLoadState() waits for a state on a navigation that has already been committed. Call it at the appropriate point in the navigation flow; if the state has already occurred, it resolves immediately.
  • Using deprecated waitForNavigation(). Prefer page.waitForURL() or an assertion for the resulting URL or page content.
  • Assuming locator.all() waits for dynamic results. It returns the elements present immediately; it does not wait for matches to appear. First wait for an appropriate result or list state, then enumerate.

Troubleshoot a wait that hangs or fails

The navigation reaches load, but the expected content is missing

Check that the locator describes the correct content and that the application is expected to render it on this route. If the content is populated asynchronously, keep the navigation and wait for the specific result with an assertion. Do not replace that check with networkidle unless network quiet is itself the requirement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
HP Essential Laptop 2026, Intel CPU, 128GB Storage, Office 365, Windows 11
  • 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.

A load-state wait fails because no navigation has started

page.waitForLoadState() is for a navigation that has already been committed. If you are navigating directly, pass the desired milestone to page.goto(). If a click triggers navigation, perform the action and wait for the resulting URL or destination state.

The test is slow with networkidle

Reconsider whether the test needs network silence. Background requests can prevent the condition from occurring, and a brief quiet period does not establish that the expected UI is ready. Replace the wait with an assertion for the particular element or state needed for the next step.

A fixed delay works sometimes but fails intermittently

The delay may be shorter than the time needed on a slower run, or longer than necessary on a faster one. Express the dependency as a locator assertion or another specific condition so the test waits for the thing it uses rather than an estimated duration.

A dynamic list is empty after navigation

locator.all() enumerates what is present at the instant it runs. Wait for a meaningful indicator that the results have loaded, such as a known result heading or item, before requesting the list.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
HP 14‘’ Laptop, 2027 Edition, Intel N150 CPU, 4GB RAM, 128GB SSD, Copilot AI, 1TB Cloud Storage, Win 11 with Microsoft 365
  • Designed for mobility with a slim 0.71-inch profile and lightweight, making it easy to carry between home, office
  • 【Versatile Connectivity】Stay connected with multiple ports including USB 3.0 Type-C, USB 3.0 Type-A, HDMI, and a headphone/mic combo jack, with Wi-Fi and Bluetooth for seamless wireless networking.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance and reliability: a practical rule

Start with page.goto(url) when the test genuinely needs the default load milestone. Choose domcontentloaded or commit when the later browser work is not a dependency. In all cases where success depends on application content, add a condition-specific assertion. This gives the test a clear success condition without confusing a generic browser event, network silence, or elapsed time with the state a user would recognize.

Or skip the browser setup

If your goal is a screenshot rather than an interactive Playwright test, ScreenshotNeo provides a website screenshot API and MCP server. Its API can return a PNG, JPEG, WebP, or PDF from one GET request; its capture options include waiting for a selector, a delay, or network idle. This is a different tool for a different job: it does not replace Playwright when you need to test page behavior.

For a screenshot call, use your own ScreenshotNeo API key and the target URL:

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

See the ScreenshotNeo API documentation for request options. ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000, and every feature is on every plan.

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

Sign up for ScreenshotNeo’s free plan to get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does page.goto() wait for the page to load by default?

Yes. Its default wait condition is the browser’s load event.

Should I use networkidle in a Playwright test?

Usually not as a general readiness check. Wait for the specific UI state the test requires.

What should I use instead of page.waitForNavigation()?

Use page.waitForURL() or assert the expected destination URL or content.

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.