Closed
Bug 1288769
Opened 9 years ago
Closed 8 years ago
switch_to_window() fails for dialogs when name specified: "NoSuchWindowException: Unable to locate window: foo"
Categories
(Remote Protocol :: Marionette, defect)
Remote Protocol
Marionette
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: whimboo, Unassigned)
References
(Blocks 1 open bug)
Details
from marionette import MarionetteTestCase
class SwitchWindow(MarionetteTestCase):
def test_dialog(self):
self.marionette.set_context("chrome")
self.marionette.execute_async_script("""
win = window.open('chrome://marionette/content/test2.xul', 'foo',
'dialog,height=200,width=300');
// Bug 1288339 - We don't wait for readyState to be complete yet
waitForWindow = function() {
if (win.document.readyState != 'complete') {
win.setTimeout(this, 100);
}
marionetteScriptFinished(true);
}()
""")
print self.marionette.chrome_window_handles
self.marionette.switch_to_window(self.marionette.chrome_window_handles[1])
self.marionette.switch_to_window('foo')
Reporter | ||
Comment 1•9 years ago
|
||
The above code snippet works if you select the newly opened dialog via the outer window id, but it fails when you try to access it via its name.
Blocks: webdriver-chrome
Summary: switch_to_window() fails for dialogs when name specified: "NoSuchWindowException: Unable to locate window: foo → switch_to_window() fails for dialogs when name specified: "NoSuchWindowException: Unable to locate window: foo"
Reporter | ||
Comment 2•8 years ago
|
||
The above testcase is incorrect because it doesn't specify the `chrome` flag for the window.open() method. As such the chrome URL will be opened in a new tab instead of a new window.
The following code which uses the WindowManagerMixin class works:
def test_dialog(self):
self.marionette.set_context("chrome")
def open_with_js():
self.marionette.execute_script("""
window.open('chrome://marionette/content/test2.xul', 'foo', 'chrome,dialog');
""")
self.open_window(trigger=open_with_js)
self.marionette.switch_to_window('foo')
As such the bug is invalid.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
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
•