We can check the presence of WebElement on page by implementing custom isElementPresent method as below:
protected boolean isElementPresent(By by) {
try {
driver.findElement(by);
return true;
} catch (NoSuchElementException e) {
return false;
}
}This method will return true, if the WebElement with ‘by’ available otherwise returns false.