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.

Error: Node is either not visible or not an HTMLElement

See original GitHub issue

Using 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
riley-tcommented, Aug 17, 2020

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.

1reaction
riley-tcommented, Aug 5, 2020

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

2020-08-05T09:18:07.933Z aws-azure-login Focusing on username input
2020-08-05T09:18:07.937Z aws-azure-login Clearing input
2020-08-05T09:18:08.049Z aws-azure-login Typing username
2020-08-05T09:18:08.580Z aws-azure-login Submitting form
Error: Node is either not visible or not an HTMLElement
    at ElementHandle._clickablePoint (<sanitised_path>\aws-azure-login-2.1.0\node_modules\puppeteer\lib\JSHandle.js:216:13)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
  -- ASYNC --
    at ElementHandle.<anonymous> (<sanitised_path>\aws-azure-login-2.1.0\node_modules\puppeteer\lib\helper.js:111:15)
    at DOMWorld.click (<sanitised_path>\aws-azure-login-2.1.0\node_modules\puppeteer\lib\DOMWorld.js:367:18)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
  -- ASYNC --
    at Frame.<anonymous> (<sanitised_path>\aws-azure-login-2.1.0\node_modules\puppeteer\lib\helper.js:111:15)
    at Page.click (<sanitised_path>\aws-azure-login-2.1.0\node_modules\puppeteer\lib\Page.js:1064:29)
    at Object.handler (<sanitised_path>\aws-azure-login-2.1.0\lib\login.js:75:24)
    at <anonymous>

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 -

2020-08-05T09:37:17.778Z aws-azure-login Found state: username input
2020-08-05T09:37:17.779Z aws-azure-login Not prompting user for username
2020-08-05T09:37:17.779Z aws-azure-login Waiting for username input to be visible
2020-08-05T09:37:17.786Z aws-azure-login Focusing on username input
2020-08-05T09:37:17.789Z aws-azure-login Clearing input
2020-08-05T09:37:17.930Z aws-azure-login Typing username
2020-08-05T09:37:18.501Z aws-azure-login Waiting for submit button to be visible
2020-08-05T09:37:18.505Z aws-azure-login Submitting form
2020-08-05T09:37:18.517Z aws-azure-login Request: https://aadcdn.msftauth.net/ests/2.1/content/images/marching_ants_white_166de53471265253ab3a456defe6da23.gif
2020-08-05T09:37:18.518Z aws-azure-login Request: https://aadcdn.msftauth.net/ests/2.1/content/images/marching_ants_b540a8e518037192e32c4fe58bf2dbab.gif
2020-08-05T09:37:18.519Z aws-azure-login Request: https://login.microsoftonline.com/common/GetCredentialType?mkt=en-US
2020-08-05T09:37:19.022Z aws-azure-login Waiting for submission to finish
2020-08-05T09:37:19.247Z aws-azure-login Request: https://aadcdn.msftauth.net/ests/2.1/content/images/marching_ants_white_166de53471265253ab3a456defe6da23.gif
2020-08-05T09:37:19.247Z aws-azure-login Request: https://aadcdn.msftauth.net/ests/2.1/content/images/marching_ants_b540a8e518037192e32c4fe58bf2dbab.gif
2020-08-05T09:37:19.250Z aws-azure-login Request: https://autologon.microsoftazuread-sso.com/itree.com.au/winauth/ssoprobe?client-request-id=<redacted>
2020-08-05T09:37:19.514Z aws-azure-login Request: https://login.microsoftonline.com/common/instrumentation/dssostatus
2020-08-05T09:37:19.804Z aws-azure-login Request: https://aadcdn.msftauth.net/ests/2.1/content/images/arrow_left_a9cc2824ef3517b6c4160dcf8ff7d410.svg
2020-08-05T09:37:19.809Z aws-azure-login Finished state: username input
2020-08-05T09:37:19.812Z aws-azure-login Found state: password input
2020-08-05T09:37:19.813Z aws-azure-login Prompting user for password
etc...

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.

Read more comments on GitHub >

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

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