Closed
Bug 991959
Opened 11 years ago
Closed 11 years ago
self.marionette.switch_to_frame() sometimes fails to switch to a valid iframe
Categories
(Remote Protocol :: Marionette, defect, P2)
Remote Protocol
Marionette
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla31
People
(Reporter: dmosedale, Assigned: mdas)
References
Details
Attachments
(1 file, 1 obsolete file)
5.87 KB,
patch
|
mdas
:
review+
|
Details | Diff | Splinter Review |
The test case at
https://github.com/adamroach/gecko-dev/blob/29027f698d4c1d260c859a3f925dbed3dbfdb1d5/browser/components/loop/test/functional/test_dummy.py
blows up with:
File "/Users/dmose/r/abr-gecko-dev/browser/components/loop/test/functional/test_dummy.py", line 24, in test_foo
self.marionette.switch_to_frame(panel_frame)
File "/Users/dmose/r/abr-gecko-dev/testing/marionette/client/marionette/marionette.py", line 889, in switch_to_frame
response = self._send_message('switchToFrame', 'ok', element=frame.id, focus=focus)
File "/Users/dmose/r/abr-gecko-dev/testing/marionette/client/marionette/decorators.py", line 35, in _
return func(*args, **kwargs)
File "/Users/dmose/r/abr-gecko-dev/testing/marionette/client/marionette/marionette.py", line 616, in _send_message
self._handle_error(response)
File "/Users/dmose/r/abr-gecko-dev/testing/marionette/client/marionette/marionette.py", line 639, in _handle_error
raise NoSuchFrameException(message=message, status=status, stacktrace=stacktrace)
NoSuchFrameException: NoSuchFrameException: Unable to locate frame: undefined
TEST-UNEXPECTED-FAIL | test_dummy.py test_dummy.TestSomething.test_foo |
Note that this is on a somewhat old (~6 weeks?) Gecko branch, trying to debug a bunch of code that hasn't yet landed on Gecko proper.
FWIW, I tried applying the latest patch in bug 929175 and it unfortunately didn't change anything.
It's quite possible that the easiest way to work through this will be to pair debug this with me over Google hangouts.
If that's too hard, I can work on turning this into a reduced test case for the current nightly.
Updated•11 years ago
|
Priority: -- → P2
Reporter | ||
Comment 1•11 years ago
|
||
The old summary gave the impression that is an intermittent failure, which, for the SocialAPI panels, so I changed it. Until it gets addressed, we can't really use Marionette to test loop.
Assignee | ||
Comment 2•11 years ago
|
||
This problem was caused by incorrect object comparison. If you do switchToFrame(WebElement) we'd retrieve a XULElement, and we'd try to compare that to what we get from window.frames, which were ChromeWindows, so the comparison would fail.
I've changed this to use getElementsByTagName("iframe") so we get all the XULElement iframes, and compare those (FYI, we won't need to worry about <frameset> frames in chrome, XUL Reference doesn't seem to support frameset)
Attachment #8403317 -
Flags: review?(dburns)
Comment 3•11 years ago
|
||
Comment on attachment 8403317 [details] [diff] [review]
fix frame switching
Review of attachment 8403317 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with the comment fixed.
::: testing/marionette/client/marionette/tests/unit/test_switch_frame_chrome.py
@@ +23,4 @@
> def test_switch_simple(self):
> self.assertTrue("test.xul" in self.marionette.get_url())
> self.marionette.switch_to_frame(0)
> + self.assertTrue("test2.xul" in self.marionette.get_url(),"Switching by index failed")
Since we are changing these, we should change the asserts to assertIn[1] so we can get a better message if this fails
[1] https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertIn
Attachment #8403317 -
Flags: review?(dburns) → review+
Assignee | ||
Comment 4•11 years ago
|
||
carrying r+ forward with changes.
pushed to m-i:
https://hg.mozilla.org/integration/mozilla-inbound/rev/4310134153c1
Attachment #8403317 -
Attachment is obsolete: true
Attachment #8404712 -
Flags: review+
Comment 5•11 years ago
|
||
Assignee: nobody → mdas
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Updated•2 years ago
|
Product: Testing → Remote Protocol
You need to log in
before you can comment on or make changes to this bug.
Description
•