switch_to_window() should provide an option not to select the underlying tab automatically

RESOLVED DUPLICATE of bug 1124604

Status

Testing
Marionette
RESOLVED DUPLICATE of bug 1124604
3 years ago
a year ago

People

(Reporter: whimboo, Unassigned)

Tracking

({ateam-marionette-client, ateam-marionette-server})

Trunk
ateam-marionette-client, ateam-marionette-server
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [needs patch on bug 1124604])

(Reporter)

Description

3 years ago
As what I have seen today is that when switch_to_window() is called, the target tab is automatically selected. This will make it impossible for us to do checks for background tabs. As Chris mentioned this behavior was added with the patch on one of his bugs.

Here a small code example which demonstrates that in Firefox:

    def test_switch_to_window(self):
        def selected_index(toolbar):
            return int(toolbar.get_attribute('selectedIndex'))

        org_handle = self.marionette.current_window_handle

        toolbar = self.marionette.find_element('id', 'tabbrowser-tabs')
        button = toolbar.find_element('anon attribute', {'anonid': 'tabs-newtab-button'})

        button.click()
        self.assertEqual(len(self.marionette.window_handles), 2)
        self.assertEqual(selected_index(toolbar), 1)

        self.marionette.switch_to_window(org_handle)
        self.assertEqual(selected_index(toolbar), 1)
Keywords: regression
I added this with the patch in bug 941749 because it would seem a convenience, but I see how it would be an unacceptable limitation for firefox-ui-tests. It's easy enough to remove, but we might have to add a parameter for this behavior if other users depend on the switching behavior.
(Reporter)

Comment 2

3 years ago
So that would be exactly the request I made via bug 1124604, but which has been wontfixed by David. As it looks like it would still be useful here. I think that it is a good reason to reopen bug 1124604, and marking this bug as dependency on it.
Depends on: 1124604
Keywords: ateam-marionette-client, ateam-marionette-server
Summary: switch_to_window() should not select the underlying tab automatically → switch_to_window() should provide an option not to select the underlying tab automatically
(Reporter)

Updated

3 years ago
Whiteboard: [needs patch on bug 1124604]
Comment hidden (obsolete)
Comment hidden (obsolete)
(Reporter)

Comment 5

2 years ago
Those two latest comments are not related to this bug which is about window/tab handling in the Marionette framework. Titus, if you have issues with Firefox then please file a bug in the Firefox General component.

Comment 6

2 years ago
Henrik, Firefox 45 supports Marionette. The gist I linked to clearly has Marionette debug info in it. I believe the issue I'm seeing is related to how tabs are selected. If it is not, I can create a new issue, but it is causing a number of the Ruby Selenium specs to fail.
(Reporter)

Comment 7

2 years ago
This bug is specifically to Marionette and switching between tabs and not windows! Please read comment 0. Here in short... switching to a tab should offer a parameter to not automatically focus the target tab.
(Reporter)

Comment 8

a year ago
Looks like a dupe of bug 1124604 now which I just got fixed.
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1124604
You need to log in before you can comment on or make changes to this bug.