Click fails with "Node is not visible", but it is
See original GitHub issueI’m running puppeteer with headless: false
Steps to reproduce
Tell us about your environment:
- Puppeteer version: 0.13.0
- Platform / OS version: Windows 7 x64
- URLs (if applicable): https://s3.amazonaws.com/yabapmatt/bottracker/bottracker.html
- Node.js version: 8.9.1
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: **
Any thoughts? Thanks very much for reading.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:14 (1 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
use hover before click:
page.hover('selector');
this works for me.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());