There is no way to access the parent of an object
Bug #1195141 reported by
Leo Arias
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_
For cases like this, having a reference to the parent will be handy.
Related branches
lp:~autopilot/xpathselect/experimental
- Martin Pitt (community): Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 1575 lines (+812/-188)12 files modifiedCMakeLists.txt (+1/-1)
debian/changelog (+7/-0)
debian/control (+2/-2)
lib/node.h (+14/-6)
lib/parser.h (+91/-11)
lib/xpathquerypart.h (+34/-5)
lib/xpathselect.cpp (+31/-6)
lib/xpathselect.h (+1/-1)
test/dummynode.h (+62/-16)
test/test_parser.cpp (+503/-114)
test/test_xpath_simple.cpp (+5/-5)
test/test_xpath_tree.cpp (+61/-21)
lp:~autopilot/autopilot-qt/experimental
- PS Jenkins bot: Approve (continuous-integration)
- Autopilot Hackers: Pending requested
-
Diff: 1194 lines (+610/-161)15 files modifieddebian/changelog (+7/-0)
debian/control (+4/-2)
driver/autopilot_types.h (+26/-0)
driver/dbus_adaptor.cpp (+1/-1)
driver/dbus_object.cpp (+4/-2)
driver/driver.pro (+2/-1)
driver/introspection.cpp (+62/-25)
driver/introspection.h (+1/-1)
driver/qtnode.cpp (+125/-50)
driver/qtnode.h (+29/-8)
driver/qttestability.cpp (+3/-0)
driver/rootnode.cpp (+15/-26)
driver/rootnode.h (+2/-4)
tests/unittests/tst_introspection.cpp (+326/-39)
tests/unittests/unittests.pro (+3/-2)
lp:~autopilot/autopilot-gtk/experimental
- PS Jenkins bot: Approve (continuous-integration)
- Martin Pitt (community): Approve
-
Diff: 957 lines (+425/-133)13 files modifieddebian/changelog (+7/-0)
debian/control (+4/-4)
debian/rules (+2/-1)
lib/GtkNode.cpp (+147/-60)
lib/GtkNode.h (+18/-8)
lib/GtkRootNode.cpp (+24/-16)
lib/GtkRootNode.h (+5/-3)
lib/Introspection.cpp (+3/-3)
lib/Variant.cpp (+168/-22)
lib/Variant.h (+3/-1)
lib/autopilot_types.h (+34/-0)
tests/autopilot/tests/test_widget_tree.py (+2/-6)
tests/autopilot/tests/test_xpath_query.py (+8/-9)
lp:~autopilot/autopilot/experimental
- PS Jenkins bot: Approve (continuous-integration)
- Martin Pitt (community): Approve
-
Diff: 3821 lines (+2175/-293)61 files modifiedautopilot/__init__.py (+4/-3)
autopilot/globals.py (+9/-2)
autopilot/ibus.py (+1/-1)
autopilot/input/_X11.py (+7/-2)
autopilot/input/_osk.py (+5/-0)
autopilot/input/_uinput.py (+5/-0)
autopilot/introspection/__init__.py (+14/-3)
autopilot/introspection/backends.py (+2/-2)
autopilot/introspection/constants.py (+1/-1)
autopilot/introspection/dbus.py (+95/-115)
autopilot/introspection/types.py (+619/-0)
autopilot/introspection/utilities.py (+6/-0)
autopilot/keybindings.py (+6/-2)
autopilot/matchers/__init__.py (+1/-1)
autopilot/process/_bamf.py (+10/-8)
autopilot/testcase.py (+5/-4)
autopilot/tests/functional/test_ap_apps.py (+31/-22)
autopilot/tests/functional/test_autopilot_functional.py (+6/-4)
autopilot/tests/functional/test_dbus_query.py (+15/-2)
autopilot/tests/functional/test_input_stack.py (+7/-2)
autopilot/tests/functional/test_introspection_features.py (+2/-1)
autopilot/tests/functional/test_open_window.py (+1/-1)
autopilot/tests/functional/test_process_emulator.py (+1/-1)
autopilot/tests/unit/test_command_line_args.py (+9/-2)
autopilot/tests/unit/test_custom_exceptions.py (+1/-1)
autopilot/tests/unit/test_introspection_features.py (+36/-5)
autopilot/tests/unit/test_matchers.py (+41/-30)
autopilot/tests/unit/test_pick_backend.py (+1/-1)
autopilot/tests/unit/test_platform.py (+7/-1)
autopilot/tests/unit/test_types.py (+579/-0)
autopilot/tests/unit/test_version_utility_fns.py (+2/-2)
autopilot/utilities.py (+6/-7)
autopilot/vis/bus_enumerator.py (+5/-5)
autopilot/vis/main_window.py (+20/-12)
autopilot/vis/objectproperties.py (+8/-2)
autopilot/vis/resources.py (+1/-1)
bin/autopilot (+21/-20)
debian/changelog (+7/-0)
debian/control (+90/-12)
debian/python-autopilot-tests.install (+3/-0)
debian/python-autopilot-tests.pyinstall (+0/-3)
debian/python-autopilot-vis.install (+1/-0)
debian/python-autopilot-vis.pyinstall (+0/-1)
debian/python-autopilot.install (+6/-0)
debian/python-autopilot.pyinstall (+0/-6)
debian/python3-autopilot-tests.install (+3/-0)
debian/python3-autopilot-trace.install (+1/-0)
debian/python3-autopilot-vis.install (+1/-0)
debian/python3-autopilot.docs (+2/-0)
debian/python3-autopilot.install (+9/-0)
debian/python3-autopilot.postinst (+24/-0)
debian/rules (+30/-2)
docs/_templates/indexcontent.html (+6/-0)
docs/api/introspection.rst (+3/-0)
docs/appendix/appendix.rst (+9/-0)
docs/appendix/protocol.rst (+366/-0)
docs/conf.py (+3/-1)
docs/contents.rst (+1/-0)
docs/porting/porting.rst (+18/-0)
docs/tutorial/advanced_autopilot.rst (+1/-1)
setup.py (+1/-1)
Changed in autopilot: | |
status: | New → Confirmed |
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 |
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.
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.