Skip to content

Fix Save Attribute appium action conflicting with element save-parameter handling#717

Merged
ToWhiD073 merged 1 commit into
devfrom
fix-appium-save-attribute-variable-collision
Jul 9, 2026
Merged

Fix Save Attribute appium action conflicting with element save-parameter handling#717
ToWhiD073 merged 1 commit into
devfrom
fix-appium-save-attribute-variable-collision

Conversation

@mahbd

@mahbd mahbd commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • LocateElement.Get_Element() has its own generic "save the located element to a variable" feature, keyed off the "save parameter" sub-field, where it treats the Field column as the variable name.
  • Save_Attribute_appium reuses that same "save parameter" tag with the opposite convention (Field = attribute to read, Value = destination variable) and was passing the raw step_data straight into Get_Element.
  • Result: for a step like content-desc | save parameter | testing, Get_Element tried to save the located element under the variable name content-desc, which fails Python identifier validation (hyphen) and logs a confusing 'content-desc' is not a valid variable name error — even though the actual attribute save into testing still worked.
  • Fixed by stripping the "save parameter" row out of the data set before calling Get_Element, mirroring the existing (correct) pattern already used in Save_Attribute for Selenium and Playwright.
  • Also added a None check on variable_name so the action fails cleanly with a clear message instead of crashing if no "save parameter" row is present.

Test plan

  • Run an Appium "save attribute" step with a hyphenated attribute name (e.g. content-desc) and confirm no spurious "invalid variable name" error is logged, and the variable is saved correctly.
  • Run an Appium "save attribute" step with a non-hyphenated attribute name (e.g. text) and confirm behavior is unchanged.
  • Confirm omitting the "save parameter" row now fails with the "Variable name should be mentioned" message instead of raising an unhandled exception.

🤖 Generated with Claude Code

…ter 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 <noreply@anthropic.com>
@riz-hossain

Copy link
Copy Markdown
Contributor

🔎 ZeuZ PR Review

Open the full report in ZeuZ: Review findings and apply suggestions

Overview Value
Agents ✅ 4 completed
Suggestions 💡 1

Agent breakdown

→ General Review

Status: ✅ Completed
Suggestions: 0 suggestions

No actionable issues found in the diff; the change correctly separates the saved-variable parameter from element location data and adds a missing validation path.

→ Security Review

Status: ✅ Completed
Suggestions: 0 suggestions

No security issues found in the PR diff. The change only refactors parameter parsing for an Appium save-attribute action and does not introduce new injection, auth, secrets, or exposure risks.

→ Performance Review

Status: ✅ Completed
Suggestions: 0 suggestions

No performance regressions or scalability concerns stand out in this PR diff; the change is narrowly scoped to fix parameter handling without introducing heavier query, memory, or I/O patterns.

→ Testing Review

Status: ✅ Completed
Suggestions: 1 suggestion

The fix changes control flow in Save_Attribute_appium, but there is no corresponding regression test covering the original collision or the new missing-variable branch.

Open ZeuZ to inspect full findings, continue an agent conversation, or apply safe patch suggestions.

@ToWhiD073 ToWhiD073 merged commit 7a5bf60 into dev Jul 9, 2026
6 checks passed
@ToWhiD073 ToWhiD073 deleted the fix-appium-save-attribute-variable-collision branch July 9, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants