.click() not working occasionally
See original GitHub issueSometimes nightwatch.js .click() method works and other times it doesn’t. I even put a .pause() to make sure the button is visible, I also inspect the element (while paused) to make sure it has the correct selector Im using and it does, but it just won’t click the element. Sometimes it does work though, any ideas?
module.exports = { 'Step 8: Search Inventory' : function (browser) { browser .waitForElementVisible('button.searchInventory', 3000) .click('button.searchInventory') .waitForElementVisible('div.newVehicleHeader > h2', 6000) .assert.elementPresent('div.newVehicleHeader > h2') .end();} };
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:25 (3 by maintainers)
Top Results From Across the Web
Click() method will not always work - Stack Overflow
I ran into a similar issue. The click method worked on other pages, then didn't work at all on a particular page.
Read more >When a Click is Not Just a Click | CSS-Tricks
The click event is usually tied to a pointer device, typically the mouse, and yet here the Space or Enter key are triggering...
Read more >Event listeners not working? 3 key areas to troubleshoot
Are your event listeners not working as you'd expect? Here are 3 key areas to troubleshoot to help you get everything triggering as...
Read more >Severe Issue! Click Stops working randomly on Windows 11
I am currently running Latest Beta version of Windows 11 and the problem is still there. This problem was in Non-beta and Alpha...
Read more >JavaScript For Loop Click Event ← Issues & Solutions Explained
To fix that, change var to let from the original code and it works. for (let i = 0 ...
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

This is not a Selenium-specific bug but a Nightwatch bug. There have been many issues open about click() not working in a consistent manner, but you seem to always close them without any fix. If you don’t want/are unable to fix this bug, please leave it open so that someone else can fix it. As a popular open source project you may have to rely on the community to fix issues.
Please see this answer on the mailing list: https://groups.google.com/forum/#!topic/nightwatchjs/3KXgjq7YiKY. You are reporting an issue with WebDriver/Selenium and not something that we can fix in Nightwatch.