-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Description
The current ExpectedConditions.elementToBeClickable
is in my mind kind of missleading, as it does a WebElement.isDisplayed()
&& WebElement.isEnabled()
check.
A more meaningful check could be done by creating a new atom WebElement.isPointerReachable()
,
this atom could use Document.elementFromPoint
to check the clickabilty of an element.
The atom must scroll to the element into the viewport (e.scrollIntoView()) and check the center & top left & top right & bottom left & bottom right points of the element does return the element or a child of the element.
This approach has some limitations, as an element larger than the viewport will allways be not pointer reachable.
But these limitations are in my mind better than the limitations of WebElement.isDisplayed()
, as they are false negative results. The isDisplayed
does trend to false positive results, what is bad in testing (e.g. an element A does overlap another element B, but element B is still considerer as displayed).
I think there is some research needed to evaluate this.
Don't you see false positive results of isDisplayed
in your tests?
I would like to know others are interrested into this?
Have you considered any alternatives or workarounds?
Implement it myself :D