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

See original GitHub issue

Something strange happens when testing my Bootstrap website using Nightwatch.

I have the following element in my page definition:

    createAccountModalBackground: {
      selector:'div.modal-backdrop'
    }

In my test I execute the following code:

    subscribePage
      .click('@subscribeLiteButton')
      .waitForElementVisible('@createAccountModal', 1000)
      .waitForElementVisible('@createAccountModalBackground', 1000)
      .click('@createAccountModalBackground')

The click never gets executed. The modal stays on screen.

If however I replace the click call with:

      client.execute(function() {
        document.querySelector('div.modal-backdrop').click()
      })

It works fine.

Is there an issue somewhere?

Do you need more information?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
MateuszJeziorskicommented, Aug 8, 2016

Maybe element is hovered by other element or you need to scroll down to the element? That would explain why this works fine

client.execute(function() {
        document.querySelector('div.modal-backdrop').click()
 })

Or you had luck and element disappear sometimes just after you check if the element is visible

Also, what do you mean The click never gets executed. The modal stays on screen. ? Is there any error?

3reactions
ir-fuelcommented, Aug 8, 2016

You are quick in closing this ticket, no? The line before doing this click I have: .waitForElementVisible('@createAccountModalBackground', 1000) so why are you concluding that the element is not visible at the time of the click? If it isn’t visible that line should fail.

edit: running my tests shows me: Element <div.modal-backdrop> was visible after 48 milliseconds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FIX: Mouse Moves but Cannot Click (Solved) - wintips.org
How to Troubleshoot Problems with your Mouse. · Step 1. Connect the mouse to another USB port. · Step 2. Shutdown and Restart...
Read more >
Mouse Left-Click Button Not Working? Here's How to Fix It
On Windows 10, head to Settings > Devices > Mouse. Under “Select your primary button,” ensure the option is set to “Left.” On...
Read more >
FIX: Mouse click not working in Windows 10/11
How can I fix the mouse clicking problem? · Run the Hardware and Devices troubleshooter · Boot in Safe Mode · Uninstall and...
Read more >
Mouse Clicks Not Registering? 14 Proven Ways To Fix It
How to Fix Mouse Click Not Registering? · Change Buttons Configurations · Lower High CPU usage · Disable USB Selective Suspend · Uninstall...
Read more >
Mouse pointer works but not able to click on Windows 10 / 11
a. If your mouse is working fine in 'Safe mode', then any of these third-party applications are causing the problem for you. Reboot...
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