From 800582fb72d28270aa18030b98586dd19be0c7ec Mon Sep 17 00:00:00 2001 From: Mahmudul Alam Date: Thu, 9 Jul 2026 16:14:47 +0600 Subject: [PATCH] Fix Save Attribute appium action conflicting with element save-parameter handling Get_Element() has its own "save parameter" feature that treats the Field column as a variable name to cache the located element under. Save_Attribute_appium reuses the same "save parameter" tag with the opposite meaning (Field = attribute to read, Value = destination variable), so passing the full step_data to Get_Element made it try to save the element under the attribute name (e.g. "content-desc"), which fails variable-name validation and logs a spurious error. Now strips the save-parameter row before calling Get_Element, matching the existing Selenium/Playwright Save_Attribute implementations. Co-Authored-By: Claude Sonnet 5 --- .../CrossPlatform/Appium/BuiltInFunctions.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/Framework/Built_In_Automation/Mobile/CrossPlatform/Appium/BuiltInFunctions.py b/Framework/Built_In_Automation/Mobile/CrossPlatform/Appium/BuiltInFunctions.py index 5f887923..de6c9f2d 100755 --- a/Framework/Built_In_Automation/Mobile/CrossPlatform/Appium/BuiltInFunctions.py +++ b/Framework/Built_In_Automation/Mobile/CrossPlatform/Appium/BuiltInFunctions.py @@ -5050,16 +5050,28 @@ def Save_Attribute_appium(step_data): return "passed" try: - Element = LocateElement.Get_Element(step_data, appium_driver) - if Element == "zeuz_failed": - CommonUtil.ExecLog(sModuleInfo, "Unable to locate your element with given data.", 3) - return "zeuz_failed" - + variable_name = None + new_ds = [] for each_step_data_item in step_data: if "save parameter" in each_step_data_item[1]: variable_name = each_step_data_item[2] attribute_name = each_step_data_item[0].strip().lower() - break + else: + new_ds.append(each_step_data_item) + + if variable_name is None: + CommonUtil.ExecLog( + sModuleInfo, + "Variable name should be mentioned. Example: (text, save parameter, var_name)", + 3, + ) + return "zeuz_failed" + + Element = LocateElement.Get_Element(new_ds, appium_driver) + if Element == "zeuz_failed": + CommonUtil.ExecLog(sModuleInfo, "Unable to locate your element with given data.", 3) + return "zeuz_failed" + try: if attribute_name == "text": attribute_value = Element.text