Skip to content
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

FIX: use the latest version of puppeteer-core package to fix page.click issue #22989

Merged
merged 2 commits into from Aug 16, 2023

Conversation

vinothkannans
Copy link
Member

If we use page.click then it's randomly failing open the user card UI. So we're now using the document.querySelector to retrive the element and click it.

If we use `page.click` then it's randomly failing open the user card UI. So we're now using the `document.querySelector` to retrive the element and click it.
@tgxworld
Copy link
Contributor

tgxworld commented Aug 7, 2023

What is the root cause of why page.click is failing randomly? Our smoke test is meant to simulate what a user will try to do and this change is not reflecting what a user will normally do.

@vinothkannans
Copy link
Member Author

@tgxworld the issue is happening only if we run the tests in headless mode. So, it doesn’t look like an issue from our side. I can see many similar reports about puppeteer’s click method on the web.

@tgxworld
Copy link
Contributor

tgxworld commented Aug 7, 2023

Hmm do you have the links to such reports? I’ll like to have a look because if a simple action like clicking something can be so unreliable in puppeteer, then I don’t think we should be using it.

@vinothkannans
Copy link
Member Author

vinothkannans commented Aug 8, 2023

https://stackoverflow.com/a/73113570
puppeteer/puppeteer#2959
@tgxworld here are some examples. Should we try updating the puppeteer to the latest version? I thought we can't do much here since this is only happens in "headless" mode.

@tgxworld
Copy link
Contributor

tgxworld commented Aug 8, 2023

Yup we can try updating puppeteer to the latest version to see if it fixes the problem. The solution being suggested is a work around and I don't think the workaround is the proper fix here. That would be admitting that puppeteer's click method is unreliable and if that is true, we shouldn't even be using puppeteer. That being said, I suspect something else is at play here. In most cases, puppeteer is clicking at a point in the page. Maybe the link is animating? Maybe try getting a screenshot of the page before we click?

Looks like the latest version fixes the flaky `page.click` issue.
@vinothkannans vinothkannans changed the title FIX: use evaluate and querySelector methods to click user link. FIX: use the latest version of puppeteer-core package to fix page.click issue Aug 15, 2023
@vinothkannans
Copy link
Member Author

Yup we can try updating puppeteer to the latest version

@tgxworld upgrading to the latest version fixes the page.click issue in my local environment.

@tgxworld
Copy link
Contributor

O this is nice 👍

@vinothkannans vinothkannans merged commit 9643151 into main Aug 16, 2023
13 checks passed
@vinothkannans vinothkannans deleted the smoke-test-click branch August 16, 2023 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants