The BaseWebElement#findElement() and BaseWebElement#findElements() methods are not checking to make sure the parent and child are not of the type XPATH. This was changed in the recent feature update for Components, not considering a use case where users might still be invoking either method during class variable instantiation or using custom Scaffold strong typed extended elements.
Expected
As a bandaid, we should update the methods to check both the parent and child during the getParentBy() check. This should allow the correct logic pathing as to how we were constructing elements before, where the returned Scaffold strong typed element is using the WebElement.class constructor.
The reason this is meant to be a bandaid is for "keep the lights on" for projects that might be using this particular type of code implementation. I highly encourage users to move away from invoking findElement() and findElements() in a class variable.
Bug
The
BaseWebElement#findElement()
andBaseWebElement#findElements()
methods are not checking to make sure the parent and child are not of the typeXPATH
. This was changed in the recent feature update forComponents
, not considering a use case where users might still be invoking either method during class variable instantiation or using custom Scaffold strong typed extended elements.Expected
As a bandaid, we should update the methods to check both the parent and child during the
getParentBy()
check. This should allow the correct logic pathing as to how we were constructing elements before, where the returned Scaffold strong typed element is using theWebElement.class
constructor.The reason this is meant to be a bandaid is for "keep the lights on" for projects that might be using this particular type of code implementation. I highly encourage users to move away from invoking
findElement()
andfindElements()
in a class variable.