-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Question] When does page.click resolve in the DOM loading lifecycle? #4020
Comments
There are two cases: page is loading before the click and page is loading after the click.
Does this answer your question? |
Yes, thank you very much for the clarification and types of strategies I can use to handle this situation. |
You are welcome! |
When navigating from another URL, I am using Playwright's
page.click
on a<div>
element with anonclick
event handler. However, Playwright will immediately attempt to click on the<div>
element's position even if the page is not fully loaded with the assigned click event listener. Playwright will then say thepage.click
succeeded, but theonclick
function will not fire.My thought was that
page.click
would wait until the page was fully loaded before attempting the click action. Looking at the debugging logs, 'waiting for scheduled navigations to finish' occurs after the click action is completed, as reflected by step 5 of thepage.click
operations in the docs. What are these scheduled navigations and when doespage.click
resolve in the DOM loading lifecycle?The text was updated successfully, but these errors were encountered: