06
Oct

TimeoutException in SeleniumWebDriver

TimeoutException : 
TimeoutException is related with explicitwait, fluentwait, pageLoadTimeOut, scriptLoadTimeout. Selenium webdriver throws the TimeoutException exception when user has defined the wait time but the element have not been found within the wait time.

Reasons : TimeoutException occurs because of one of the below reasons
Element is not present or given Condition is not met
When the given timeout is very low
When page takes more time to load
When executeAsyncScript() takes more time to return its operation

Code which causes the TimeoutException :
WebDriverWait wait = new WebDriverWait(driver, 30);
WebElement idElement;
idElement = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("123")));