Comment 1 for bug 1082388

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

Hi,

A couple of things:

First, get_children and get_children_by_type only return the immediate children of the object you call that method on. It allows you to specify a string as the first argument, in case you don't have an emulator class defined. This was missing from the get_children_by_type method, but there's a MP that fixes that here: https://code.launchpad.net/~thomir/autopilot/fix-docs/+merge/137453

So you should be able to do:

obj.get_children_with_type('MyType', prop1=value1, ...)

Second, the application proxy object has methods 'select_single' and 'select_many' which take *exactly* the same arguments, but will select an object from the entire application tree. The docstring for select_single is at least accurate:

        """Get a single node from the introspection tree, with type equal to
        *type_name* and (optionally) matching the keyword filters present in
        *kwargs*.

        For example:

        >>> app.select_single('QPushButton', objectName='clickme')
        ... returns a QPushButton whose 'objectName' property is 'clickme'.

        If nothing is returned from the query, this method returns None.

        :raises: **ValueError** if the query returns more than one item. *If you
         want more than one item, use select_many instead*.

        """

I hope this resolves this issue for you. I'm marking the bug as invalid - please feel to re-open it if you still have issues.

Cheers,