waitForLoadState waitUntil domcontentloaded doesn't wait
See original GitHub issueSorry if I am misusing the method.
await page.waitForLoadState({ waitUntil: "domcontentloaded" });
let elementHandle = await page.$('input[name="username"]');
await elementHandle.type(USER_DETAILS.username); <- crashes as elementHandle is null
but
await page.waitFor('input[name="username"]');
let elementHandle = await page.$('input[name="username"]');
await elementHandle.type(USER_DETAILS.username); <- works fine
Thanks a lot!
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Playwright: how to wait until there is no animation on the page?
There are several options that may help you. 1. Solution 1: First, you can maybe determine which element is loading last, and then...
Read more >Avoiding hard waits in Playwright and Puppeteer
We try to solve this issue with a hard wait, like Puppeteer's page. ... waitForNavigation to wait until a page navigation (new URL...
Read more >Navigating & waiting - Checkly
Navigating to some web page; Waiting for something; Possibly getting a timeout ... Both options 2a and 2b are passed using the waitUntil...
Read more >How to make puppeteer wait for page to load - Urlbox
It fires when the initial HTML document's DOM has been loaded and parsed. However, this does NOT wait for stylesheets, images, ...
Read more >playwright/page-wait-for-load-state.spec.ts at ... - Gitnet
await page.goto(server.PREFIX + '/one-style.html', {waitUntil: 'domcontentloaded'});. await page.waitForLoadState('domcontentloaded');.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
is there a link to that stretch feature? Because I’m running into the lack of “wait for DOM to be stable” and it makes running visual diffing considerably harder than it needs to be because neither
networkidle
nordomcontentready
are useful for modern sites that use React or Vue or the like. For those, thenetworkidle
/domcontentready
events in fact signal the start of the DOM mutation process, rather than any “this page is now stable” event, in effect being the exact opposite of a useful signal =)But even i
await page.goto(...)
, I am getting these still-loading screenshots. Doesn’t that mean thedomcontentloaded
haven’t fired yet?How can I ensure that the page is fully loaded before I continue?