Closed Bug 1283941 Opened 8 years ago Closed 7 years ago

switchToWindow fails with the name of the window as parameter

Categories

(Remote Protocol :: Marionette, defect)

47 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: florentbr, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Steps to reproduce: import marionette client = marionette.Marionette('localhost', port=2828) client.start_session() client.navigate("about:blank") client.execute_script("window.open('about:blank', 'mywindow');") client.switch_to_window("mywindow") Actual results: The window is not found and an exception is raised: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python27\lib\site-packages\marionette_driver\marionette.py", line 1385, in switch_to_window self._send_message("switchToWindow", {"name": window_id}) File "C:\Python27\lib\site-packages\marionette_driver\decorators.py", line 36, in _ return func(*args, **kwargs) File "C:\Python27\lib\site-packages\marionette_driver\marionette.py", line 757, in _send_message self._handle_error(err) File "C:\Python27\lib\site-packages\marionette_driver\marionette.py", line 818, in _handle_error raise errors.lookup(error)(message, stacktrace=stacktrace) marionette_driver.errors.NoSuchWindowException: NoSuchWindowException: Unable to locate window: kk Expected results: The driver should be able to set the context on the window for the provided name. The issue is in the Marionette component in driver.js in switchToWindow: https://dxr.mozilla.org/mozilla-central/source/testing/marionette/driver.js#1308 The driver should be comparing the provided name with `browser.contentWindow.name` and not `win.name`: 1308c1308,1309 < if (byNameOrId(win.name, contentWindowId, outerId)) { --- > let contentWindowName = browser.contentWindow.name; > if (byNameOrId(contentWindowName, contentWindowId, outerId)) {
Version: Trunk → 47 Branch
Depends on: 1301073
We shouldnt support switching by name. You need to pass in the Window ID
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.