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() not working occasionally

See original GitHub issue

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

github_iconTop GitHub Comments

13reactions
mdurbancommented, Aug 31, 2017

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.

11reactions
beatfactorcommented, Oct 12, 2016

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.

Read more comments on GitHub >

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

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