How to check if an Element exists, when using Page Objects with webdriver.
So far I am doing it this way.
DefaultPage defaultPage = PageFactory.initE
try this is defiantly work in pom
public boolean isPrebuiltTestButtonVisible() { try { if (preBuiltTestButton.isEnabled()) { return true; } else { return false; } } catch (Exception e) { e.printStackTrace(); return false; } }
this will definitely work in page object model surround with try catch