exceptions after waits code example
Example 1: how to waitselenium webelement java
WebDriver driver = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(By.id("button1")));
wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("text_box1")));
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id("text_box1")));
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Example 2: exceptions after waits
- implictlyWait --> NoSuchElementException
- explicitly wait -> TimeOutException