-2

first time posting a question here

I'm pretty new to nightwatch and trying to click a button which is a div class inside other divs i searched around for some solutions but with no luck..

HTML pic (not enough points yet to post inline)

the element is visible when i check it : .verify.visible('div.test-button')

But when try to click nothing happens : .click('div.test-button')

Any help is appreciated

** tried also to move to element and click but also didn't work:
.moveToElement('.test-button', 10, 10) .mouseButtonClick(0)

qadod
  • 1
  • 2

2 Answers2

0

Answer :: Found a way to make it and other elements clickable - for anyone that is searching for similar click issues

this method worked for me :

.execute(function(selector) {
      document.querySelector(selector).click();
   }, ['YOURSELECTOR'])
qadod
  • 1
  • 2
0

I had the same issue when I launched my tests on "chrome_latest" version. The key word here is LATEST! It seems that Google Chrome was updated but Nightwatch or Selenium didn't update its engine according Google Chrome LATEST version. As a result I launched my tests on Microsoft EDGE. And what do you think? IT WORKS! You have to edit a bit your magellan.json file (if you use it of course):

"profiles": {
    "some_profile": [
      {
        "browser": "MicrosoftEdge_latest_Windows_10_Desktop",
        "resolution": "1280x960"
      }
    ]
}
Artem
  • 1