appium / appium/ruby_lib_core

Support ability to return attributes from elementResponseAttributes

Open
#698 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
40
Forks
22
Avg merge
3h 25m
Merged PRs (30d)
17

Description

This is a

  • Feature Request

Summary

I've already written a patch to implement this feature, but just wanted to check before formatting it into a PR that it would be accepted.

The short is that when setting elementResponseAttributes for android/iOS and disabling compact responses with the capability shouldUseCompactResponses: false Calls to appium start returning the attributes specified, instead of just the element id which is great. The issue is that the appium bridge: Appium::Core::Base::Bridge which inherits from Selenium::WebDriver::Remote::Bridge doesn't actually do anything with these attributes, it only reads the element id. The methods find_element_by and find_elements_by need to be modified so that we can have our attributes returned and Appium::Core::Element needs to hold onto these attributes`

Currently when querying any attribute for an element, it always performs a HTTP request, so I think it needs to be very clear that when accessing these returned attributes, they aren't refreshed and can be stale. I used the method cached_attributes to represent the attributes returned when fetching the element, but very open to using different naming, it does feel important to differentiate between the existing behaviour of always fetching attributes vs when you want to fetch one of the values returned initially.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Appium::Core::Base::Bridge, especially find_element_by and find_elements_by, then inspect Appium::Core::Element's existing attribute access. Confirm how non-compact element responses are handled and how returned values can be distinguished as cached_attributes from refreshed attributes. Done means the specified attributes are retained and accessible without changing existing refresh behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
mobile-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.