Closed Bug 869626 Opened 12 years ago Closed 12 years ago

is_displayed() throwing a StaleElementException immediately after find_element()

Categories

(Remote Protocol :: Marionette, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: bsilverberg, Unassigned)

Details

Attachments

(1 file)

Based on a discussion in IRC today, find_element() should always return a fresh element, i.e. if we call a method on an element immediately after getting a handle on it with find_element() that method should not throw a StaleElementException. One exception to this would be if a page transition happened between the call to find_element() and the element method, but this is highly unlikely. We have a test case where we can consistently reproduce a StaleElementException when calling is_displayed() on an element immediately after finding it, and this seems to contradict the expected behaviour. I am attaching the test case so that it can be reproduced for debugging. We do have a workaround for our test, which involves calling find_element(x).is_displayed() inside a wait_for_condition, and we're not entirely sure why it is working in that context and not when it's simply called on its own. As we have a workaround this is not a high priority, but it would be interesting to know why this is happening and if it is indicative of a Marionette bug.
I have done some more investigation and this seems to be a timing issue. Even though we are chaining find_element() and is_displayed(), the element seems to become stale *between* those two calls. I don't think this is a marionette issue.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: