New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
waitForNavigation timeout after clicking #4133
Comments
Hey there, Not 100% sure, but the reason why your code fails sometimes is probably because you are running the two asynchronous calls in parallel in this code: ...
await Promise.all([
page.waitForNavigation({ waitUntil: 'networkidle0', timeout: 10002 }),
page.click('div[title="Delete"]'),
])
... Promise.all() runs the two promises in parallel and my guess is that it fails when the click promise resolves before the waitForNavigation promise. Anyways, to my understanding, ...
await page.waitForNavigation({ waitUntil: 'networkidle0', timeout: 10002 }),
await page.click('div[title="Delete"]'),
... Give it a try and let me know. |
Hey @TAnas0, I've tried this before any many other combinations, but according to the Puppeteer documentation and other Github Issues related to the raise conditions when clicking and then navigating, this Best, |
Hey @adamshiervani, This seems to be a dupe of #4011 and should be fixed in v1.13.0. Can you please check if it works for you in the latest release? |
@aslushnikov works perfectly 🙏! Thanks a lot! |
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
What is the expected result?
Expect to evaluate wether there are any divs with title: 'Delete' if there are any elements then click the div and then wait for a new page navigation
What happens instead?
It works for the majority of the time i run it, but sometimes the
waitForNavigation()
just times out.Navigation Timeout Exceeded: 10002ms exceeded
.The script i run is not running in headless mode, so i can actually see that the element that should be clicked on is actually there. The while loop condition just confirmed a couple calls above the the element is there, but it's just not getting clicked.
I've had a lot of problems with the
waitForNavigation()
withclick()
raise conditions, i've followed the suggested solution in the docs, but it's not quite working. This is just one the places where the script sporadically fails.I also tried to troubleshoot this on my own and ran the script with
DEBUG=puppeteer:protocol
as a env variable. I only found on difference in the protocol calls comparing a working with a not-working run.This doesn't show up when the script is failing.
RECV {"method":"Runtime.executionContextCreated","params":{"context":{"id":202,"origin":"","name":"__puppeteer_utility_world__","auxData":{"isDefault":false,"type":"isolated","frameId":"889BEECA90FEC4532115BF7B9E10D93E"}}}, "sessionId": "8ED0498B4FFF2743B720279C6EB46369"}
Protocol Debug logs
The only difference i found can be seen on line 29.
WORKING
FAILING
The text was updated successfully, but these errors were encountered: