Most of the time we get element not found exception/errors, we use Try catch block and first try to use WebDriverWait class to make webdriver wait for element to be visible for certain amount of time. If WebDriver fails to detect element in specified amount of time, lets say 10 sec, we put that into catch block and call same function again, where webdriver will wait for the element. We do such 10 iterations and if elment is not found, we implemented another method to identify in catch block. Lets say first we were identifying using CSS selector when CSS did not work, we used xpath.