I'm sure watir-webdriver had support for the CSS selector, but it looks like it is gone:
$ ruby -v ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0] $ gem -v 1.8.15 $ gem list selenium-webdriver *** LOCAL GEMS *** selenium-webdriver (2.17.0) $ gem list watir-webdriver *** LOCAL GEMS *** watir-webdriver (0.4.1) $ irb > require "watir-webdriver" => true > browser = Watir::Browser.new :firefox => #<Watir::Browser:0x787eb29124fb7658 url="about:blank" title=""> > browser.goto "google.com" => "http://www.google.com.mx/" > browser.a(:css => "a").flash Watir::Exception::MissingWayOfFindingObjectException: invalid attribute: :css from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:228:in `assert_valid_as_attribute' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:209:in `normalize_selector' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:191:in `block in normalized_selector' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:188:in `each' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:188:in `normalized_selector' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:76:in `find_first_by_multiple' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/locators/element_locator.rb:33:in `locate' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/elements/element.rb:285:in `locate' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/elements/element.rb:259:in `assert_exists' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/elements/element.rb:206:in `style' from /Users/zeljko/.rvm/gems/ruby-1.9.3-p0/gems/watir-webdriver-0.4.1/lib/watir-webdriver/elements/element.rb:103:in `flash' from (irb):4 from /Users/zeljko/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'
Environment: Mac OS X 10.7.2, Firefox 9.0.1.
Am I doing something wrong?
source share