Closed Bug 1088223 Opened 10 years ago Closed 8 years ago

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

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla49

People

(Reporter: ahal, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: pi-marionette-server)

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.
Blocks: webdriver-chrome
No longer blocks: m21s
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: 8 years ago
Depends on: 1277083
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.