Skip to content

Commit 3788a8b

Browse files
committed
Fix incorrect logic in Save Attribute Value action
1 parent 8628ca1 commit 3788a8b

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Framework/Built_In_Automation/Web/Playwright/BuiltInFunctions.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,16 +1047,18 @@ async def Save_Attribute(step_data):
10471047

10481048
attribute_name = None
10491049
save_variable = None
1050+
save_attribute = None
10501051

10511052
for left, mid, right in step_data:
10521053
left_l = left.strip().lower()
10531054
mid_l = mid.strip().lower()
10541055
right_v = right.strip()
10551056

1056-
if mid_l == "input parameter":
1057+
if mid_l in ["input parameter", "element parameter"]:
10571058
attribute_name = left.strip() # Keep original case
10581059
elif mid_l == "save parameter":
1059-
save_variable = left.strip()
1060+
save_variable = right_v
1061+
save_attribute = left_l
10601062

10611063
if not attribute_name:
10621064
CommonUtil.ExecLog(sModuleInfo, "No attribute name specified", 3)
@@ -1094,10 +1096,10 @@ async def Save_Attribute(step_data):
10941096
elif attr_lower == "disabled":
10951097
value = await locator.is_disabled()
10961098
else:
1097-
value = await locator.get_attribute(attribute_name)
1099+
value = await locator.get_attribute(save_attribute)
10981100

10991101
sr.Set_Shared_Variables(save_variable, value)
1100-
CommonUtil.ExecLog(sModuleInfo, f"Saved '{attribute_name}' = '{value}' to '{save_variable}'", 1)
1102+
CommonUtil.ExecLog(sModuleInfo, f"Saved '{save_attribute}' = '{value}' to '{save_variable}'", 1)
11011103
return "passed"
11021104

11031105
except Exception:

0 commit comments

Comments
 (0)