From 52a8f88681d7e3081f3d50152887e54bf6ab7009 Mon Sep 17 00:00:00 2001 From: Hubix9 <11819738+Hubix9@users.noreply.github.com> Date: Fri, 21 Jul 2023 20:49:50 +0200 Subject: [PATCH] Fixed incorrect XPATH indexing in path_to method --- telenium/mods/telenium_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telenium/mods/telenium_client.py b/telenium/mods/telenium_client.py index ce276ff..6842ade 100644 --- a/telenium/mods/telenium_client.py +++ b/telenium/mods/telenium_client.py @@ -111,9 +111,11 @@ def path_to(widget): root = Window if widget.parent is root or widget.parent == widget or not widget.parent: return "/{}".format(widget.__class__.__name__) + filtered_children = [child for child in widget.parent.children if type(child) == type(widget)] + filtered_children.reverse() return "{}/{}[{}]".format( path_to(widget.parent), widget.__class__.__name__, - widget.parent.children.index(widget)) + filtered_children.index(widget)) def rpc_ping():