Smart Wait with puppeteer
See original GitHub issueWhat are you trying to achieve?
Define Smart waits using puppeteer
What do you get instead?
I need to set wait on each statement
Provide console output if related. Use
--verbose
mode for more details.
# paste output here
Provide test source code if related
// paste test
Details
- CodeceptJS version:
- NodeJS Version:
- Operating System:
- Protractor || WebDriverIO || Nightmare version (if related)
- Configuration file:
# paste suite config here
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Avoiding hard waits in Playwright and Puppeteer
Explicit waits are a type of smart wait we invoke explicitly as part of our script. We will want to use them more...
Read more >Smart Wait with puppeteer · Issue #1277 · codeceptjs ... - GitHub
Define Smart waits using puppeteer What do you get instead? I need to set wait on each statement Provide console output if related....
Read more >Avoiding hard waits - Checkly
Both Puppeteer and Playwright offer many different kinds of smart waits, but Playwright takes things one step further and introduces an auto-waiting ......
Read more >puppeteer waits for first element to load - Stack Overflow
If you want to set a timeout, I would do it in the page.waitForSelector in Puppeteer. await page.goto('https://stackoverflow.com/questions/ ...
Read more >Testing with Puppeteer - A Complete Guide - HeadSpin
log(err); } finally { await browser.close(); } })();. In the code above, we are using Puppeteer to test the title of the web...
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 FreeTop 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
Top GitHub Comments
Cool. Thank you.
Let me write here the ideas behind SmartWait:
SmartWait was created because there was implicit wait API in WebDriver. https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp So basically it works by turning on/off implicit waits when a CSS/XPath selector is searched.
However, for Puppeteer there is no such API so this functionalioty should be implemented manually.
SmartWait works only for CSS/XPath locators, because when we do fuzzy search we try different locators. So a link or button is not found we should search by image inside a link, span inside link, etc. So you can make few empty tries before getting a valid result. So SmartWait should not work for fuzzy locators.
You can use either promise-retry library or setInterval to make a poll for a new elements.
A basic example.
I don’t think it is needed with retryFailedStep plugin