I am trying:
public void assertIsDisplayed(WebElement element) {
{
String actualText = element.getText();
try {
Assert.assertTrue(element.isDisplayed(), actualText + " is not displayed on the page");
Reporter.log(actualText + " is displayed on the page",true);
}
catch (AssertionError e) {
Reporter.log("Assertion Error: " + e.getMessage());
throw e;
}
}
}
but in console output or logs failed message is not displayed.