0

I have an element I'd like to check the content of, however, nightwatch isn't recoginsing it, even though it is visible on the screen.

  browser.waitForElementPresent('mySelector', 20000) //this succeeds
  browser.waitForElementVisible('mySelector', 20000) //this fails
  browser.verify.containsText('mySelector', 'text') //this also fails (of course)

I checked screenshots at fails, and I can definitely see the html element containing the text I'm looking at, and it works with other similar elements I have.

I'm curious to know what nightwatch itself is looking at when checking for visibility, because I cannot see any hidden attributes in the html element either.

JenO
  • 1
  • 2
  • Can you share the HTML dom, maybe the element is covered by some hidden elements that you cannot see with your eyes? – Alapan Das Jun 24 '21 at 16:30
  • Like mention above. Please share the HTML dom, it might me covered by an Iframe or it need to me highlighted, mouse hover over etc – Vladislav Bulanov Jul 26 '21 at 11:11
  • How was this solved? Having the same problem where the selectors are correct, i can see the element, but nightwatch is failing. – Ye' Thura Ag Aug 22 '22 at 09:12

1 Answers1

-1

Problem was with the fact that elements with the same selector stayed in the DOM. Solved by using nth child.

JenO
  • 1
  • 2