Closed
Bug 864296
Opened 13 years ago
Closed 13 years ago
Marionette webelement.find_element(locator) returns values even if the webelement is no longer present on the page
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(firefox21 wontfix, firefox22 wontfix, firefox23 fixed, b2g18 fixed, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 fixed)
RESOLVED
FIXED
mozilla23
People
(Reporter: Bebe, Assigned: jgriffin)
References
Details
Attachments
(2 files)
|
2.43 KB,
text/plain
|
Details | |
|
1.25 KB,
patch
|
mdas
:
review+
|
Details | Diff | Splinter Review |
This is a little complicated.
1. Store a webelement in a variable
2. delete the webelement from the page
3. call the stored webelement from the var and check it's properties
Espected:
3. calling properties for a webelement that doesn’t exist should return a exception NoSuchElementException or something similar
Actual:
3. calling the webelement returns false positive data
Here is the code:
#store a web element in a var
element = self.marionette.find_element(*self._favorite_list_locator)
# check some basic properties
print element.is_displayed()
print element.text
print element.find_element(*self._remove_locator).is_displayed()
self.assertTrue(element.find_element(*self._remove_locator))
print "======================"
print "delete the element"
#delete the web element
self.marionette.tap(element.find_element(*self._remove_locator))
time.sleep(2)
print "element is deleted"
print "====================="
# call the same properties. This methods should return exceptions
print element.is_displayed()
print element.text
print element.find_element(*self._remove_locator).is_displayed()
self.assertTrue(element.find_element(*self._remove_locator))
#searching for the same element again returns a error
self.marionette.find_element(*self._favorite_list_locator)
I have added in the attachment the full test
| Reporter | ||
Comment 1•13 years ago
|
||
Webdriver returns a StaleElementReferenceException
selenium.common.exceptions.StaleElementReferenceException: Message: u'Element is no longer attached to the DOM'
selenium test: https://gist.github.com/bebef1987/5434882
Comment 2•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/file/ea3ffdbddc53/testing/marionette/marionette-elements.js#l108
We check if the element is no longer a part of the document, but I suppose if GC hasn't run yet, perhaps it still is part of the document. The way the element is being removed is :
https://github.com/mozilla-b2g/gaia/blob/master/apps/fm/js/fm.js#L588
that is, we should be checking its parentNode to see if it is not null.
Updated•13 years ago
|
Blocks: 801898
Summary: Marionette webelement.find_element(locator) retuns values even if the webelement is no longer pressent on the page → Marionette webelement.find_element(locator) returns values even if the webelement is no longer present on the page
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → jgriffin
| Assignee | ||
Updated•13 years ago
|
Attachment #740252 -
Attachment mime type: text/x-python → text/plain
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #743956 -
Flags: review?(mdas)
| Assignee | ||
Comment 4•13 years ago
|
||
Comment 5•13 years ago
|
||
Comment on attachment 743956 [details] [diff] [review]
Check for detached elements,
Review of attachment 743956 [details] [diff] [review]:
-----------------------------------------------------------------
Ah, cool, this should do it
Attachment #743956 -
Flags: review?(mdas) → review+
| Assignee | ||
Comment 6•13 years ago
|
||
Target Milestone: --- → mozilla23
Comment 7•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 8•13 years ago
|
||
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox21:
--- → wontfix
status-firefox22:
--- → wontfix
status-firefox23:
--- → fixed
Keywords: checkin-needed
| Assignee | ||
Comment 9•13 years ago
|
||
Updated•3 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•