Error: Node is either not visible or not an HTMLElement
See original GitHub issueUsing aws-azure-login@1.7.0
with puppeteer@1.19.0
I get this error intermittently, and I’m not sure what triggers it. After entering my username, aws-azure-login fails with this error:
aws-azure-login --profile alinta
Logging in with profile 'alinta'...
? Username: Ronnie.Gane@alintaenergy.com.au
Error: Node is either not visible or not an HTMLElement
at ElementHandle._clickablePoint (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/JSHandle.js:199:13)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async ElementHandle.click (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/JSHandle.js:265:20)
at async DOMWorld.click (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/DOMWorld.js:367:5)
at async Object.handler (/usr/lib/node_modules/aws-azure-login/lib/login.js:68:13)
-- ASYNC --
at ElementHandle.<anonymous> (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/helper.js:111:15)
at DOMWorld.click (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/DOMWorld.js:367:18)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Object.handler (/usr/lib/node_modules/aws-azure-login/lib/login.js:68:13)
-- ASYNC --
at Frame.<anonymous> (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/helper.js:111:15)
at Page.click (/usr/lib/node_modules/aws-azure-login/node_modules/puppeteer/lib/Page.js:1031:29)
at Object.handler (/usr/lib/node_modules/aws-azure-login/lib/login.js:68:24)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Using Node v12.10.0 (npm v6.11.3) on Ubuntu. I’ve tried with other versions of node (v7.6.0) and still get the same error.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Puppeteer in NodeJS reports 'Error: Node is either not ...
Error : Node is either not visible or not an HTMLElement. The following code picks a link that in both cases is off...
Read more >Node is either not visible or not an HTMLElement for ...
Run my script with changes for selectors and see node is either not or not exists visible error on 6 iteration. If your...
Read more >Resolve CloudWatch canary error "Node is either not ...
Resolution. When creating a CloudWatch canary, the "Node is either not visible or not an HTMLElement" error is typically caused by: Using ...
Read more >Node is either not visible or not an HTMLElement (flaky ...
Node is either not visible or not an HTMLElement (flaky selenium test). Closed, ResolvedPublic.
Read more >webdriverio/webdriverio - Gitter
Error : Node is either not visible or not an HTMLElement" . But the element was in visible state . I am running...
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 Free
Top 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
The changes have been working well for me since pulling 2.2.2
I’m happy for this to be closed if there are no objections from the others.
Hello 👋
I’m relatively new here, but I have been using the aws-azure-login tool for a while now. This particular problem has become quite painful to live with so I thought I’d have a crack at fixing it for both myself and everyone else dealing with it.
Looking at the previous comments and reproducing the problem (on my machine… hah), what I have found telling is ‘where’ it appears to be failing - during the ‘Submitting form’ step as shown below
Looking at where this debug statement is makes be believe that the error is potentially caused by an attempt to click the Submit button before it’s actually ready / visible, even though the username field is, somehow, available for input in that moment. In some situations I’ve witnessed the same issue occurring on the username input field as well (as seen in previous comments) when the network is particularly slow, but I’ve found this much harder to reliably reproduce.
I will put in a PR with two additions that have fixed the problem for me as shown in a run through with these changes here -
It’s two blocks of code that make the process wait until the elements in question are visible before attempting to interact with them. Feedback is welcome on whether this approach is appropriate / safe / working and whether it will actually solve the problem for others.