Introspecting Dash results raises Exception

Bug #1031011 reported by Víctor R. Ruiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
Invalid
Undecided
Unassigned
Unity
Triaged
Undecided
Unassigned
unity (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

#!/usr/bin/env python

from __future__ import absolute_import

from autopilot.emulators.X11 import Keyboard
from unity.emulators.dash import Dash
from time import sleep

def dash():
    """ Dash tests """
    # Get dash
    dash = Dash()
    # Show the dash
    dash.ensure_visible(clear_search=True)
    # Show Application lens
    dash.reveal_application_lens()
    # Search for Terminal
    keyboard = Keyboard()
    keyboard.type('Terminal')
    # Wait
    sleep(10)
    # Get active lens
    lens = dash.get_current_lens()
    # Get Installed category
    category = lens.get_category_by_name('Installed')
    # Get results of Installed applications
    results = category.get_results()
    for result in results:
        print result.__state

if __name__ == '__main__':
    dash()

---

Xlib.protocol.request.QueryExtension
Xlib.protocol.request.QueryExtension
Backend : gconf
Integration : true
Profile : unity
Adding plugins
Initializing core options...done
Traceback (most recent call last):
  File "./test_dash.py", line 33, in <module>
    dash()
  File "./test_dash.py", line 30, in dash
    print result.name
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 247, in __getattr__
    self.refresh_state()
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 222, in refresh_state
    name, new_state = self.get_new_state()
  File "/usr/lib/python2.7/dist-packages/autopilot/introspection/dbus.py", line 278, in get_new_state
    raise StateNotFoundError(self.__class__.__name__, self.id)
autopilot.introspection.dbus.StateNotFoundError: State not found for class with name 'Result' and id '33683'.

Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

This is a problem in Unity - the dee model objects are all allocated in such a way that we can only wrap them in an adapter when adding them to the introspection tree. This happens each time an autopilot query arrives, so the Ids are different for each query, which in turn makes trouble for autopilot.

Probably the only way to fix this is to export the dash result objects differently from within Unity - not as separate objects in the object tree, but as an array of results from one of the existing dash objects.

Changed in autopilot:
status: New → Invalid
Changed in unity:
status: New → Triaged
assignee: nobody → Thomi Richards (thomir)
Changed in unity (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.