I know I could use (driver.findElements(By.xpath("Xpath Value")).size() != 0);
However, I am using a Page Object Model, whose entire purpose is to predefine the WebElements in a separate class, so I don't have to "FindElements By" in my test classes.
Here's what I currently have
if (objPage.webElement.isEnabled()){
System.out.println("found element");
}else{
System.out.println("element not found");
}
However, this tries to identify the possibly non-existent WebElement. When it is not present, I get:
No Such Element" exception.