FindElementsByXPath (plural) vs FindElementByXPath (singular)
I'm finding a number of scenarios where FindElementsByXPath returns no results where the identical locator used in the singular form of the method (FindElementByXPath) does return the expected element.
Any idea why this might be the case?
FindElement uses the implicit timeout awaiting the element to be keyboard focusable. FindElement will fail if the element is not found. FindElements has no guarantee on the elements existence before completing and returning any elements existing at that moment. (Or in your case not existing yet.)
@liljohnak , Thanks for the reply. Indeed, I'm aware of the usage of the implicit timeout for FindElement and have verified that the elements exist before either FindElements or FindElement executes. So, it does seem quite strange.
Another strange behavior is FindElementsByClassName includs the parent element in the search
Another strange behavior is FindElementsByClassName includs the parent element in the search
Yep. I see that consistently too. It's one of the reasons I try to use XPath, though that leads me to other strange behaviors. Would be so powerful to use if MS would get their act together on supporting this. But, so much time is spent working around these quirks in the implementation.
It seems that ms:experimental-webdriver: true option breaks FindElementsByXPath.
I set the option to false and FindElementsByXPath works.
See #1284