private boolean isElementPresent_internal ( ) throws WidgetException { try { try { final boolean isPotentiallyXpathWithLocator = ( locator instanceof EByFirstMatching ) || ( locator instanceof EByXpath ) ; if ( isPotentiallyXpathWithLocator && isElementPresentJavaXPath ( ) ) return true ; } catch ( Exception e ) { // Continue } findElement ( ) ; return true ; } catch ( NoSuchElementException e ) { return false ; } }
Use the JavaXPath to determine if element is present . If not then try finding element . Return false if the element does not exist