public boolean verifyText(final By by, final String text) {
		WebElement element = driver.findElement(by);

		if (element.getText().equals(text)) {
			LOG.info("Element: " + element + " contains the given text: "
					+ text);
			return true;
		}

		LOG.info("Element: " + element + " does NOT contain the given text: "
				+ text);

		return false;
	}
public boolean verifyText ( final By by , final String text ) { WebElement element = driver . findElement ( by ) ; if ( element . getText ( ) . equals ( text ) ) { LOG . info ( "Element: " + element + " contains the given text: " + text ) ; return true ; } LOG . info ( "Element: " + element + " does NOT contain the given text: " + text ) ; return false ; }
Verifies that the given element contains the given text.

@param by
the method of identifying the element
@param text
the text to be matched
@return true if the given element contains the given text or false
otherwise