lib/watir-webdriver/locators/element_locator.rb in watir-webdriver-0.0.2 vs lib/watir-webdriver/locators/element_locator.rb in watir-webdriver-0.0.3
- old
+ new
@@ -2,12 +2,22 @@
module Watir
class ElementLocator
include Watir::Exception
include Selenium
- WD_FINDERS = [ :class, :class_name, :id, :link_text, :link,
- :partial_link_text, :name, :tag_name, :xpath ]
+ WD_FINDERS = [
+ :class,
+ :class_name,
+ :css,
+ :id,
+ :link,
+ :link_text,
+ :name,
+ :partial_link_text,
+ :tag_name,
+ :xpath
+ ]
def initialize(wd, selector, valid_attributes)
@wd = wd
@selector = selector.dup
@valid_attributes = valid_attributes
@@ -136,10 +146,10 @@
when :text
element.text
when :tag_name
element.tag_name
else
- element.attribute(how) rescue "" # TODO: rescue specific exception
+ element.attribute(how)
end
end
def matches_selector?(selector, element)
# p :start => selector