Try this: b.a(:id => 'home',:class => 'current').exists?
On Friday, April 20, 2012 3:05:46 PM UTC-4, Joe Fl wrote: > > Hi, > > How do i use more than one html tag to identify a link? > > I need to use the id and class for the below. > > <a id="home" class="current" href="https://my-staging.within3.com/ > channels/within3-playground/navigational_categories/home/pages/<https://my-staging.within3.com/channels/within3-playground/navigational_categories/home/pages/> > > index">Home</a> > > I tried the following got an error: > b.a(:id,'home',:class,'current').exists? > > ArgumentError: expected Hash or (:how, 'what'), got [:id, > "home", :class, "current"] > from /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir- > webdriver-0.3.4/lib/watir-webdriver/container.rb:26:in > `extract_selector' > from /Users/josephfleck/.rvm/gems/ree-1.8.7-2010.02/gems/watir- > webdriver-0.3.4/lib/watir-webdriver/elements/generated.rb:773:in `a' > from (irb):109 > from :0 > > Any help would be greatly appreciate. > > Thank you, > Joe -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected]
