module Appium::Ios

def find_eles_attr tag_name, attribute

Returns:
  • (Array) - an array of strings containing the attribute from found elements of type tag_name.

Parameters:
  • attribute (String) -- the attribute to collect
  • tag_name (String) -- the tag name to find
def find_eles_attr tag_name, attribute
  # Use au.lookup(tag_name) instead of $(tag_name)
  # See https://github.com/appium/appium/issues/214
  js = %Q(
      var eles = au.lookup('#{tag_name}');
      var result = [];
      for (var a = 0, length = eles.length; a < length; a++) {
        result.push(eles[a].#{attribute}());
      }
      result
    )
  @driver.execute_script js
end