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.

Click fails with "Node is not visible", but it is

See original GitHub issue

I’m running puppeteer with headless: false

Steps to reproduce

Tell us about your environment:

What steps will reproduce the problem?

Below is my code. setTimeout was an attempt to fix this issue if it was some sort of timing issue, but it has no effect on the outcome.

const puppeteer = require('puppeteer');

async function run() {
	const browser = await puppeteer.launch({
		headless: false
	});
	const page = await browser.newPage();
	page.setViewport({width:960,height:768});
	try {
		await page.goto('http://s3.amazonaws.com/yabapmatt/bottracker/bottracker.html', {waitUntil: 'load'});
	}
	catch (error) {
		console.log(error);
		browser.close();
	}

	await page.waitForSelector('#disclaimer', {visible: true})
	.then(() => {
		console.log("Found the button");
		setTimeout(() => {
			page.click('.modal-footer .btn.btn-default')
			.then(() => {
				console.log("Clicked!")
			})
		}, 5000);
	})
}

run();

What is the expected result? Button is clicked, modal closes

What happens instead? Node is not visible

Full messages printed to my terminal:

Found the button
(node:35320) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Node is not visible
(node:35320) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

**Image of button in question: ** image

Any thoughts? Thanks very much for reading.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:14
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
zhouxiangxiangcommented, May 11, 2018

use hover before click: page.hover('selector'); this works for me.

10reactions
dlssocommented, Jun 2, 2020

For people who are getting this issue but not using an SVG, there is more help in #1805.

I used page.$eval(selectorStr, elem => elem.click());

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer in NodeJS reports 'Error: Node is either not visible ...
I'm trying to emulate the behaviour of a real user clicking around the site, which is why I use .click() , and not...
Read more >
Troubleshoot Tableau Server Install and Upgrade
Many Tableau Server issues can be addressed with some basic steps: Make sure there is enough disk space on each computer running Tableau...
Read more >
Resolve CloudWatch canary error "Node is either not visible ...
I created an Amazon CloudWatch canary using the GUI Workflow Builder. However, my canary failed and I received the following error: "Node is ......
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 >
Top 10 Most Common Node.js Developer Mistakes - Toptal
Node.js, the cross-platform runtime environment, has seen its fair share of ... often referred to as “callback hell”, is not a Node.js issue...
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