public boolean isTextPresent ( String pattern ) { String text = getElement ( ) . getText ( ) ; return ( text != null && ( text . contains ( pattern ) || text . matches ( pattern ) ) ) ; }
It is to check whether the element s text matches with the specified pattern .