Method: Watir::Element#attribute_values
- Defined in:
- lib/watir/elements/element.rb
#attribute_values ⇒ Hash Also known as: attributes
Returns all attribute values. Attributes with special characters are returned as String, rest are returned as a Symbol.
348 349 350 351 352 353 354 355 356 |
# File 'lib/watir/elements/element.rb', line 348 def attribute_values result = element_call { execute_js(:attributeValues, @element) } result.keys.each do |key| next unless key == key[/[a-zA-Z-]*/] result[key.tr('-', '_').to_sym] = result.delete(key) end result end |