Page.click does not work as expected in slowMo mode
See original GitHub issueI’m opening google.com and type ‘test’ in the input box. Then click the submit button. Using slowMo:250 this leaves enough time for the autocomplete dropdown box to show up. The Page.click event then goes to the list element which is located at the position of the submit button. Therefor a different search result will show up.
This applies to both headless and non-headless mode.
const browser = await puppeteer.launch({slowMo: 250});
//const browser = await puppeteer.launch({headless: false, slowMo: 250});
const page = await browser.newPage();
await page.goto('https://google.com');
await page.type('input[name=q]', 'test');
await page.click('input[type=submit]');
await page.screenshot({path: 'google.png'});
await browser.close();
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Puppeteer - clicks do not work outside of slowMo
I'm navigating with Puppeteer around a React website. Two sample lines of code: await page.
Read more >Unable to click on the CONFIGURATION link - xk6-browser
Hi Team, I'm trying to navigate to below URL and click on CONFIGURATION. I tried the below script and its not working. Please...
Read more >Solutions to Fix Video Playing in Slow Motion on Windows
Do you see video slow-motion where it was not supposed to be? No worries! Check these tips to eliminate it and make your...
Read more >Puppeteer documentation - DevDocs
Puppeteer is a Node library which provides a high-level API to control Chromium or Chrome over the DevTools Protocol. The Puppeteer API is...
Read more >Known Issues | Cribl Docs
Problem : When you hover over the Monitoring page's graphs, the expected red/yellow/green status indicators are missing. Fix: In Cribl Edge 3.4.2.
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
Using
page.evaluate(element => element.click(), elementHandle)
will do a fake JavaScript click.This is working as intended. Google search gives you a separate button to press when the dropdown is active:
input.lsb
. Clicking the hidden button would be undefined behavior, because google.com wouldn’t expect that to be possible.Consider a link with an image in it:
<a><img></a>
It is impossible to click the<a>
without clicking the<img>
. Wouldpage.click('a')
be a failure or a success? How aboutpage.click('img')
?This is a really common problem people are running into, so I would like some better reporting of what is going on. But I don’t know how to do it in a way that is consistent and not restrictive. PRs are welcome 👍