Hi Al, Awesome that worked. I can't believe that was it. Why is it like that and should I expect more like this?
Thank you, Joe On Oct 11, 4:32 pm, Al Snow <jas...@hotmail.com> wrote: > Look at > this:http://groups.google.com/group/watir-general/browse_thread/thread/707... > > Date: Tue, 11 Oct 2011 16:18:03 -0400 > Subject: Re: [wtr-general] Re: Trying to use SafariWatir and receiving an > error when keying value into a text_field > From: joeflec...@gmail.com > To: watir-general@googlegroups.com > > Ok, > > I made the correct to the script to initialize the browser variable. I ran > my script again and it seems it is broken at the password field. > > Line from my script: > puts "Key in correct password." > > $browser.text_field(:type, 'password').set user_pswd > > ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:85:in > `method_missing': Watir::Exception::MissingWayOfFindingObjectException > > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in > `send' > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/locators.rb:10:in > `locator' > > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:534:in > `operate_by_locator' > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:149:in > `operate' > > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in > `focus' > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in > `set' > > from > /Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43 > > I have also tried > > puts "Key in correct password." > $browser.text_field(:id, 'password').set user_pswd > > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:661:in > `execute': Unable to locate TextField, using :id and "password" > (Watir::Exception::UnknownObjectException) > > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir/scripter.rb:303:in > `focus' > from > /Users/josephfleck/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/safariwatir-0.4.0/lib/safariwatir.rb:525:in > `set' > > from > /Users/josephfleck/Documents/workspace/test/Add_Discussion_Safari.rb:43 > > It can find the email address field just find using (the below) without any > problems. > > #Typing in user name into User Name field > > puts "Key in correct username." > $browser.text_field(:name, 'username').set user_Ideer > > The script works just fine in Firefox and Chrome but using safariwatir it > stops here. > > Thank you, > > Joe > > On Tue, Oct 11, 2011 at 1:49 PM, Željko Filipin <zeljko.fili...@gmail.com> > wrote: > > On 11. 10. 2011., at 18:15, Joe Fl <joeflec...@gmail.com> wrote: > > > undefined method `text_field' for nil:NilClass (NoMethodError) > > That means @browser variable is not initialized, if I understood yourcode. > > > Do I need the require 'watir' along with the require 'safariwatir' > > request in my script? > > No. I am not sure that you can even install watir on mac. > > Zeljko > > -- > > Before posting, please readhttp://watir.com/support. In short: search before > you ask, be nice. > > watir-general@googlegroups.com > > http://groups.google.com/group/watir-general > > watir-general+unsubscr...@googlegroups.com > > -- > > Before posting, please readhttp://watir.com/support. In short: search before > you ask, be nice. > > watir-general@googlegroups.com > > http://groups.google.com/group/watir-general > > watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com