What is the Difference Between Wait until Visible and Wait until Located in Selenium What is the Difference Between Wait until Visible and Wait until Located in Selenium selenium selenium

What is the Difference Between Wait until Visible and Wait until Located in Selenium


As your question is the difference between wait(until.elementLocated(element, timeout)) and wait(until.elementVisible(element, timeout)) and you haven't tagged any Selenium binding, I will explain it from a Java perspective.

  • until.elementLocated() is equivalent to presenceOfElementLocated() in Java. It checks that an element is present within the HTML DOM of a page. This does not necessarily mean that the element is visible. So there's no guarantee that it's interactable.
  • until.elementVisible() is equivalent to visibilityOfElementLocated() in Java. It checks that an element is present within the HTML DOM of a page and is visible. Visibility means that the element is not only displayed but also has a height and width that is greater than 0. Again this does not necessarily mean that the element is interactable, i.e. clickable.

For more details on ExpectedConditions in Java, see the docs.


Wait until visible does exactly that. It waits until the element is visible. An element can be in the DOM but be hidden. In that case, it would be able to be located but not visible.


Both until.elementLocated(element, timeout) and until.elementVisible(element, timeout) are used to get the element.

But I would guess that elementLocated will be faster because it's just check that an element is present on the DOM of a page and not necessarily mean that the element is visible. while the elementVisible has to check that an element is present on the DOM of a page and visible. Visibility means that the element is not only displayed but also has a height and width.

Hope this will explain the difference.