Rajagopalan
Rajagopalan

Reputation: 6064

Both XPaths point to the same element, but one throws the error that the element is invisible while the other does not

I wrote the following XPath:

//li[.//span[text()='Owner']]//span[text()='Add']

However, WATIR/Selenium reports that the element is invisible. Interestingly, when I use //span[text()='Add'], it works fine. Both XPaths points to the same span when I am checking via developer tools. What could be causing this discrepancy?

Upvotes: 0

Views: 81

Answers (0)

Related Questions