Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7161143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:31:02+00:00 2026-05-28T13:31:02+00:00

I am pretty sure watir-webdriver had css selector support, but looks like it is

  • 0

I am pretty sure watir-webdriver had css selector support, but looks like it is not there any more:

$ 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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:31:03+00:00Added an answer on May 28, 2026 at 1:31 pm

    watir-webdriver currently only supports this if you use Browser#element

     browser.element(:css => "a")
    

    We could add support for other element methods, but we’d have to find a way to handle e.g.

     browser.a(:css => "div.foo")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm pretty sure it's not possible, but i'll throw this out there anyways. I
Pretty sure there is an easy answer to this, but just can't find the
I'm pretty sure there should be a more Pythonic way of doing this -
I am pretty sure there is and answer out there.. But I can't seem
I'm pretty sure it has been asked before, but I could not find anything
I'm not pretty sure if this question is for here, but I want to
I'm pretty sure there's something wrong with this part of a switch statement, but
Pretty sure there is a way to do this but what I tried so
I am pretty sure there is a common idiom, but I couldn't find it
I am pretty sure of the answer but I would like someone to confirm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.