From: Ban Hoang Date: 2006-09-12T05:53:43+09:00 Subject: Re: how to click the Buttons in Forms I still get an error if I use: $ie.frame("bottom").button(:value, /Login/).click ---- 1) Error: test_01_LoginTestCase(TC_pulldownBox_Links_Clicks): Watir::Exception::UnknownObjectException: Unable to locate object, using value and (?-mix:Login) c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click' Login_test1.rb:24:in `test_01_LoginTestCase' 1 tests, 0 assertions, 0 failures, 1 errors >Exit code: 1 ----- Try to use the .submit method: $ie.frame("bottom").button(:name, /Login/).submit And got the error 1) Error: test_01_LoginTestCase(TC_pulldownBox_Links_Clicks): NoMethodError: undefined method `submit' for # Login_test1.rb:24:in `test_01_LoginTestCase' -----Original Message----- From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf Of Patrick Spence Sent: Monday, September 11, 2006 12:36 PM To: ruby-talk ML Subject: Re: how to click the Buttons in Forms Ban Hoang wrote: > Hi , > $ie.frame("bottom").button(:value, ":: Login >").click > HTMl source: ( this is frame_bottom) > >
> > > > class=field size=15 maxlength=50> > >   name=password type=password value="" class=field size=15 > maxlength=50> > >   type=submit value=":: Login >" class=button> > > > >
> > 1) Error: > > test_01_LoginTestCase(TC_pulldownBox_Links_Clicks): > > Watir::Exception::UnknownObjectException: Unable to locate object, using > value and :: Login > > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2009:in `click' > > Login_test1.rb:25:in `test_01_LoginTestCase' > Just for S&G, try... $ie.frame("bottom").button(:value, /Login/).click Better yet, just call the .submit() method of the form itself. -- Posted via http://www.ruby-forum.com/.