Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -re2c906a7b5fde31d48d168f097fe6a5a2ab0afea -r4e2b2a08fb10fb528e782a505eaab19f63874cc4 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision e2c906a7b5fde31d48d168f097fe6a5a2ab0afea) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 4e2b2a08fb10fb528e782a505eaab19f63874cc4) @@ -1,5 +1,6 @@ import squish import test +import object def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ @@ -12,3 +13,17 @@ except LookupError: test.fail("ERROR : " + error_message) return None + +def setObjectText(obj, text): + obj["text"] = text + return obj + +def findChildByText(parent_object, target_text): + """Recursively finds a child object by its text property.""" + for child in object.children(parent_object): + if hasattr(child, "text") and str(child.text) == target_text: + return child + found = findChildByText(child, target_text) + if found: + return found + return None \ No newline at end of file