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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -