the isDisplayed method is a little tricky. It first looks into UIHierarchy to get the element and then checks if it’s displayed (elements can also be covered or disabled, still being present in the hierarchy.
So in order to get an actual result IT HAS to be present. Otherwise the find Element method is throwing the Exception.
Another way of achieving the goal if element/s are present is to use a WebElement array.
try:
ArrayList list = wd.findElementsByID(androidID);
boolean isPresent = list.size > 0;
So you look for Elements having this ID, if list.size equals 0, this Element is not present (not present in UIHierarchy AND Screen)
That way you wont trigger an exception or failure, cause looking for elements in array can also return null, without failing or getting a NoSuchElementException.
But I agree that the isDisplayed() method is not really clarified, hence there are other methods like isEnabled(), isVisible()