Worth noting that the documentation has alternatives to hard-coding the wait times (page.waitForTimeout). Some commands like fill and click have auto waits built-in. Or you can explicitly wait for an object to appear in the DOM.
// Playwright waits for #search element to be in the DOMawaitpage.fill('#search','query');
// Wait for #search to appear in the DOM.awaitpage.waitForSelector('#search',{state:'attached'});
I’m a full stack software developer, technical writer, and UI/UX Designer.
I love playing Football, watching football, Weight lifting, and playing Chess. :)
Worth noting that the documentation has alternatives to hard-coding the wait times (page.waitForTimeout). Some commands like
fill
andclick
have auto waits built-in. Or you can explicitly wait for an object to appear in the DOM.https://playwright.dev/path=docs%2Fcore-concepts.md&q=auto-waiting#version=master
Hi Aleccc,
I've updated the article to use this approach as recommended in the docs. Thank you for pointing that out :)