question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Page.click does not work as expected in slowMo mode

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
JoelEinbindercommented, Dec 2, 2017

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.

0reactions
JoelEinbindercommented, Dec 4, 2017

Consider a link with an image in it: <a><img></a> It is impossible to click the <a> without clicking the <img>. Would page.click('a') be a failure or a success? How about page.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 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found