java - webdriver findElement throws NoSuchElementException even though its inside try/catch -
i have problem method throwing nosuchelementexception when driver can't find element "error-row". use method in 2 cases. 1 should return true, , 1 should return false. se why throwing exception?
public boolean iserrormessagepresent() { try { driver.findelement(by.classname("error-row")); return true; } catch (nosuchelementexception e) { return false; } }
edit:
i pointing nosuchelementexception java.util library. changed this: catch (org.openqa.selenium.nosuchelementexception e) , worked!
Comments
Post a Comment