Selenium invisibilityOf(element) method throwing NoSuchElementException + WebDriverWait.ignoring(NoSuchElementException.class) is not working
问题 This query consists of 2 related questions. I need to wait for an element to be invisible before I go to next step, hence I tried to define a custom method as below: public void waitToDisappear(long timeOutInSeconds, WebElement element) { WebDriverWait wait = new WebDriverWait(driver, timeOutInSeconds); wait.ignoring(org.openqa.selenium.NoSuchElementException.class); wait.until(ExpectedConditions.invisibilityOf(element)); } When I call this method as common.waitToDisappear(5, <WebElement>); ,