I believe narko is right and here's some code that I think proves it.
By hiddenLocator = By.id("csi");
FirefoxDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://www.google.com");
WebElement hiddenEle = driver.findElement(hiddenLocator);
WebDriverWait wait = new WebDriverWait(driver, 30);
wait.until(ExpectedConditions.presenceOfElementLocated(hiddenLocator));
System.out.println("done");
I went to google.com and found an element that was hidden
<textarea name="csi" id="csi" style="display:none"></textarea>
I set the implicit wait to 30s, set up a WebDriverWait
for 30s, and then waited for the element to be present. From the presenceOfElementLocated()
source
An expectation for checking that an element is present on the DOM of a page. This does not necessarily mean that the element is visible.
If implicit wait was waiting for anything other than just the presence of the element in the DOM, it would have waited for 30s... but it finished as soon as the page was loaded in the browser.
I did some research to better understand what these different functions are doing and how they are truly different. Here's what I found...
WebElement
has three methods related to this question: isDisplayed(), isEnabled(), and isSelected(). From the docs...
isDisplayed() Is this element displayed or not? This method avoids the
problem of having to parse an element's "style" attribute.
isEnabled() Is the element currently enabled or not? This will
generally return true for everything but disabled input elements.
isSelected() Determine whether or not this element is selected or not.
ExpectedConditions
also comes into play here with several methods. I'll just look briefly at elementToBeClickable()
. From the docs...
elementToBeClickable An expectation for checking an element is visible
and enabled such that you can click it.
If you look at the source, the description is accurate. You can look at the source for the other methods, etc. if you want more info but I think this is enough to answer your question.