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.

ByChained should provide an atomic behavior #6093

Open
@lukeis

Description

@lukeis

Originally reported on Google Code with ID 6093

What steps will reproduce the problem?
1. Construct a ByChained locator over several By clauses
2. Prepare a page where the ByChained locator will locate a target element
3. Search for the element using the ByChained locator, while removing DOM nodes in
the search path from the deepest element to the surface one (introducing a race condition)

What is the expected output?
It should either return the targeted element (which would later become stale), or throw
a NoSuchElementException.

What do you see instead?
In some cases, a StaleElementReferenceException is thrown.

Selenium version:
OS: Windows 7 64 bits
Browser: Firefox
Browser version: 22.0

The StaleElementReferenceException is probably induced by an intermediate element in
the search path that becomes stale while findElements() is applied to it.

The contract and the semantic of findElement and findElements do not imply that an
action is performed on any found element, which would mean that the targeted elements
are either found or not, possibly throwing a NoSuchElementException.
Therefore, a thrown StaleElementReferenceException indicates that the concept of finding
elements is not abstracted enough in ByChained.

Reported by jeremiah.menetrey on 2013-08-13 12:50:53

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions