Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rdf6668769f32a66a7a3ce7b5956726142b67cecf -r53c5b62d1fbf9121df012d6c025f482bfd3826b0 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision df6668769f32a66a7a3ce7b5956726142b67cecf) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 53c5b62d1fbf9121df012d6c025f482bfd3826b0) @@ -1,5 +1,6 @@ import squish import test +import object def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ @@ -11,4 +12,23 @@ return squish.waitForObject(names_dict, timeout_ms) except LookupError: test.fail("ERROR : " + error_message) - return None + return None + +def setObjectText(obj, text): + obj["text"] = text + return obj + +def findObjectById(parent, id): + """ + Recursively searches for a child object by its id. + Returns the found object or None if not found. + """ + if str(parent.id) == id: + return parent + + for child in object.children(parent): + found = findObjectById(child, id) + if found: + return found + + return None \ No newline at end of file