Hi, What is the error you get when running 'ie.link(:id,"one").click'.
You could try a couple of things. Change the double quotes to single: ie.link(:href,'http://pragmaticprogrammer.com/titles/ruby/').click ie.link(:id,'one').click change 'link' to 'a': ie.a(:href,'http://pragmaticprogrammer.com/titles/ruby/').click ie.a(:id,'one').click ie.a(:text,'Pickaxe').click Make sure you include the require statements at the beginning of your script. require 'rubygems' require 'watir' Joe On Tue, Sep 18, 2012 at 3:51 AM, crabeatter <[email protected]> wrote: > Hello, every body,i am new to watir and i hava a problem in using watir.My > Html page is: > <html> > <head></head> > <a href="http://pragmaticprogrammer.com/titles/ruby/" id="one" > name="book">Pickaxe</a> > </body> > </html> > I use watir like this: > ie.link(:href,"http://pragmaticprogrammer.com/titles/ruby/").click > or ie.link(:id,"one").click > but it gets error:t.rb:66:in `assert_exists': Unable to locate element, > using {:tag_name=>["a"], : > href=>"http://pragmaticprogrammer.com/titles/ruby/"} > (Watir::Exception::UnknownObjectException). > So what's the problem?How to resolve it? > I am very happy if you help me.Thank you. > > -- > 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] -- 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]
