There is no way to access the parent of an object

Bug #1195141 reported by Leo Arias
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Autopilot
Fix Released
High
Unassigned
Autopilot Qt Support
Fix Released
High
Unassigned
XPathSelect
Fix Released
High
Unassigned
autopilot-gtk
Fix Released
High
Unassigned

Bug Description

<elopio> thomi: is there a way to select the parent of an object?
<thomi> elopio: not yet, but please file a bug, and I'll add it. I've been meaning to add it for a while now

I'm working with the ubuntu-ui-toolkit, and I currently have a reference to the MainView object. From this, I would like to access the parent of this object, the QQuickView. From the MainView this is not possible, as it has no reference to the app, so I can't call select_single('QQuickView')

For cases like this, having a reference to the parent will be handy.

Related branches

Leo Arias (elopio)
Changed in autopilot:
status: New → Confirmed
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

I started working on this today, and then realised that we cannot complete this work unless we extend the xpathselect wire protocol. The reason is simple: there's no restriction that says that each object in the tree must occupy a unique path within the tree, so there's no way, given a child path string, to get a path that is guaranteed to select the child's parent.

@Leo, how critical is this? It wouldn't be hard to add to xpathselect, but these updates to the xpathselect language are rather burdensome... so I'd rather bundle it together with other changes in the future, if at all possible.

Revision history for this message
Leo Arias (elopio) wrote : Re: [Bug 1195141] Re: There is no way to access the parent of an object

>
> @Leo, how critical is this? It wouldn't be hard to add to xpathselect,
> but these updates to the xpathselect language are rather burdensome...
> so I'd rather bundle it together with other changes in the future, if at
> all possible.

No critical at all for me. I found that the globalRect property of the
object I was looking at has the same x and y values than its parent. So I'm
currently using that and it works.

Thanks for looking into this.

Revision history for this message
Leo Arias (elopio) wrote :

Found another use case.
On the file manager app, we tap a file in order to open the actions pop over. The open_popover method is on the file emulator, but the pop over is not its child. So in order to wait for the popover to open, we need to access the file parent that has access to the popover.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Also ran into this on dropping letters and having a heck of a time, since the opened popover is not a child of the parent.

Revision history for this message
Leo Arias (elopio) wrote :

Nicholas, I've been working this around defining the methods on the MainView emulator, as it has access to everything.
That's not optimal, of course.

Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Just a bump to say hitting this again, could we get this pushed up the list to get done?

Changed in autopilot-qt:
status: New → In Progress
Changed in autopilot:
status: Confirmed → In Progress
Changed in xpathselect:
status: New → In Progress
Changed in autopilot-gtk:
status: New → In Progress
Changed in autopilot:
assignee: nobody → Thomi Richards (thomir)
Changed in autopilot-qt:
assignee: nobody → Thomi Richards (thomir)
Changed in xpathselect:
assignee: nobody → Thomi Richards (thomir)
Changed in autopilot-gtk:
assignee: nobody → Thomi Richards (thomir)
importance: Undecided → High
Changed in xpathselect:
importance: Undecided → High
Changed in autopilot-qt:
importance: Undecided → High
Changed in autopilot:
importance: Undecided → High
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:xpathselect at revision 38, scheduled for release in xpathselect, milestone 1.3

Changed in xpathselect:
status: In Progress → Fix Committed
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:autopilot-qt at revision 71, scheduled for release in autopilot-qt, milestone Unknown

Changed in autopilot-qt:
status: In Progress → Fix Committed
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:autopilot at revision 325, scheduled for release in autopilot, milestone 1.4

Changed in autopilot:
status: In Progress → Fix Committed
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:autopilot-gtk at revision 53, scheduled for release in autopilot-gtk, milestone Unknown

Changed in autopilot-gtk:
status: In Progress → Fix Committed
Changed in autopilot:
milestone: none → 1.4
Changed in autopilot:
status: Fix Committed → Fix Released
Changed in autopilot-qt:
status: Fix Committed → Fix Released
Changed in xpathselect:
status: Fix Committed → Fix Released
Changed in autopilot-gtk:
status: Fix Committed → Fix Released
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.