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] Node is either not visible or not an HTMLElement

See original GitHub issue

Context:

Playwright Version: 0.15.0 Operating System: Ubuntu 18.04.4

Code Snippet

(async () => {
  // below lines used to create a profile with name 'add_profile_test'
  await page.click('#add-profile-btn');
  await page.fill('#profile input[type=text]','add_profile_test');
  await page.click('#dialog-btn');
  // after create it, then select it
  await page.waitForSelector('text=add_profile_test', {waitFor: 'visible',});
  await page.click('text=add_profile_test');
})

Describe the bug

when try to click the element (‘text=add_profile_test’), it reports ‘Node is either not visible or not an HTMLElement’. but if I add one line page.waitFor(1000) before await page.click('text=add_profile_test'), then it can work, I don’t understand why. Shouldn’t waitForSelector and waitFor function work for this?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
dgozmancommented, May 4, 2020

@dgozman @pavelfeldman I believe this has been fixed in 0.16.0. Is it possible that #2047 fixed this?

That’s wonderful! It might be #2047 or #2020 or any other improvement 😄

1reaction
thernstigcommented, Apr 27, 2020

The waitForSelector should not be needed at all since actions like page.click() automatically auto-wait for elements. Check this: https://github.com/microsoft/playwright/blob/master/docs/core-concepts.md#auto-waiting

But, if it is visible when doing the page.click() the above is indeed strange.

(Hi Lei 😄)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer in NodeJS reports 'Error: Node is either not visible ...
click (); // Error: Node is either not visible or not an HTMLElement })();. I'm trying to emulate the behaviour of a real...
Read more >
Node is either not visible or not an HTMLElement for ... - GitHub
Node is either not visible or not an HTMLElement for page.click() in Puppeteer 1.6 # ... this part await page.click('#sign-in-btn') throws
Read more >
Node is either not visible or not an HTMLElement (flaky ...
Looks like the drawer animation is still running when the attempt to click it is made (race condition). image.png (784×1 px, 71 KB)....
Read more >
Resolve CloudWatch canary error "Node is either not visible ...
Resolution. When creating a CloudWatch canary, the "Node is either not visible or not an HTMLElement" error is typically caused by: Using ...
Read more >
webdriverio/webdriverio - Gitter
I got the following error "Node is either not visible or not an HTMLElement. Error: Node is either not visible or not an...
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