lib/firewatir/element_collections.rb in firewatir-1.6.7 vs lib/firewatir/element_collections.rb in firewatir-1.7.0.rc1
- old
+ new
@@ -37,11 +37,11 @@
def locate_elements
locate_tagged_elements(element_class::TAG)
end
- # Return all the elements of give tag and type inside the container.
+ # Return all the elements of given tag and type inside the container.
#
# Input:
# tag - tag name of the elements
# types - array of element type names. used in case where same
# element tag has different types like input has type image, button etc.
@@ -64,9 +64,13 @@
if types.include?("textarea") || types.include?("button")
search_tag = '*'
else
search_tag = tag
end
+
+ # In HTML, getElementsByTagName is case insensitive. However, in XHTML, it needs to be lowercase.
+ search_tag = search_tag.downcase
+
jssh_command << "var #{elements_tag} = null; "
jssh_command << "#{elements_tag} = #{container_name}.getElementsByTagName(\"#{search_tag}\");"
# generate array containing results