Marionette can't access the "selected" attribute on XUL tab elements

RESOLVED FIXED in mozilla49

Status

defect
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: ahal, Unassigned)

Tracking

(Blocks 1 bug, {pi-marionette-server})

unspecified
mozilla49
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

It is not currently possible to call the 'selected' attribute of tabs. This makes it difficult (if not impossible) to determine what the active tab is.

STR:
self.marionette.set_context('chrome')
tab = self.marionette.find_element('tag name', 'tab')
tab.get_attribute('selected')

Expected:
Returns the value of 'selected' or None

Actual:
Raises AttributeError: 'module' object has no attribute 'ElementNotSelectableException'

I did some digging and it seems to be because we are failing this check in upstream webdriver:
https://code.google.com/p/selenium/source/browse/javascript/atoms/dom.js#112

It's not really clear whether this is something we should fix upstream, or workaround in marionette. I'm guessing the latter since we probably shouldn't be using the shared elem.getAttribute() method on Firefox specific widgets.
The "Actual" above is actually another bug in marionette.. but it's trying to raise this:
http://dxr.mozilla.org/mozilla-central/source/testing/marionette/client/marionette/marionette.py#684
Comparing an element to gBrowser.selectedTab in an execute_script call could be a viable workaround for this.
This was basically blocked by bug 1277083 because `selected` is a JS property and not a DOM attribute. With get_property() in place for chrome it works now:

1481573320683	Marionette	TRACE	conn5 -> [0,9,"getElementProperty",{"id":"72be0568-5c5e-0145-8d9a-bec7751719a8","name":"selected"}]
1481573320690	Marionette	TRACE	conn5 <- [1,9,null,{"value":true}]
Status: NEW → RESOLVED
Closed: 3 years ago
Depends on: 1277083
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.