lib/watir-webdriver/locators/element_locator.rb in watir-webdriver-0.6.1 vs lib/watir-webdriver/locators/element_locator.rb in watir-webdriver-0.6.2
- old
+ new
@@ -327,10 +327,14 @@
if selectors.has_key?(:text) || selectors.has_key?(:label) || selectors.has_key?(:index)
return false
end
+ if selectors[:tag_name] == 'input' && selectors.has_key?(:type)
+ return false
+ end
+
if selectors.has_key?(:class) && selectors[:class] !~ /^[\w-]+$/ui
return false
end
true
@@ -367,9 +371,13 @@
when :text, 'text'
'normalize-space()'
when :href
# TODO: change this behaviour?
'normalize-space(@href)'
+ when :type
+ # type attributes can be upper case - downcase them
+ # https://github.com/watir/watir-webdriver/issues/72
+ XpathSupport.downcase('@type')
else
"@#{key.to_s.gsub("_", "-")}"
end
end