Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Possible race in ExpectedConditions.visibilityOfAllElementsLocatedBy() #7134

Open
@lukeis

Description

@lukeis

Originally reported on Google Code with ID 7134

What steps will reproduce the problem?

1. Use wait.until(ExpectedConditions.not(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.className('my-class'))))
to wait for an element to disappear.
2. This sometimes throws an exception while calling element.isDisplayed(). I was able
to reproduce it only when using RemoteWebDriver on a (slow) virtual machine running
Windows 7.

It seems there is a race condition in visibilityOfAllElementsLocatedBy() between retrieving
the element and calling isDisplayed() on it. When the element disappears after the
findElements() call but before the isDisplayed call a StaleElementReferenceException
is thrown. Other calls to isDisplayed(), e.g. in invisibilityOfElementLocated(), catch
NoSuchElementException and StaleElementReferenceException. I think these should also
be caught in visibilityOfAllElementsLocatedBy().

Selenium version: 2.39.0
OS: Windows 7
Browser: Chrome/Firefox

Reported by leroy.vanengelen on 2014-03-27 11:53:59

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions