 <p>Sometimes the element you are trying to find is loading, s0 will throw an exception using <pre> <code> <code>findElement(By.xpath(xpathLocator))</code> </code> </pre></p> <p>Therefore we would need do what Dejan Veternik has recommended, it will help wait until the ELEMENT has been loaded in the webpage, I am passing Selenium and extracting webdriver, this is helpful incase you are using WebDriverBackedSelenium just like me ...</p> <pre><code> private boolean isElementPresent(WebDriverBackedSelenium driver, String id) { try { driver.getWrappedDriver().findElement(By.id(id)); return true; } catch (Exception e) { return false; } } </code> </pre>