[wtr-general] Re: uninitialized constant Watir::Container::TextField (NameError)
Try this (after adding your login and password.) -- Al require 'watir' #include Watir Watir::Browser.default = 'ie' #ie = Browser.new ie = Watir::Browser.new #Open yahoo mail. ie.goto("http://mail.yahoo.com";) #Put your user name. ie.text_field(:name, "login").set("") #Put your password. ie.text_field(:name,"passwd").set("") #Click Sign In button. ie.button(:name,".save").click #Click Sign Out button. ie.link(:text, "Sign Out").click #Close the browser. ie.close On Feb 11, 5:23 am, Bill Xu wrote: > Hi Martin: > I am not sure whether it because you missed install process > c:\>gem install windows-pr > for more information please refer > tohttp://wiki.openqa.org/display/WTR/Install+Watir > Thanks! > Bill > > On Wed, Feb 11, 2009 at 4:58 PM, Martin wrote: > > > C:\>gem update --system > > Updating RubyGems > > Nothing to update > > > C:\>gem install watir > > Successfully installed watir-1.6.2 > > 1 gem installed > > Installing ri documentation for watir-1.6.2... > > Installing RDoc documentation for watir-1.6.2... > > > My script: > > require 'watir' > > include Watir > > Watir::Browser.default = 'ie' > > $ie = Browser.new > > #Open yahoo mail. > > $ie.goto("http://mail.yahoo.com";) > > > #Put your user name. > > $ie.text_field(:name,"login").set("User_Name") > > $ie.text_field(:name, "login").set("User_Name") > > #Put your password. > > $ie.text_field(:name,"passwd").set("Password") > > > #Click Sign In button. > > $ie.button(:value,"Sign In").click > > > #Click Sign Out button. > > $ie.link(:text, "Sign Out").click > > > #Close the browser. > > $ie.close > > > When I run it, I got uninitialized constant > > Watir::Container::TextField (NameError). > > > Does anyone know what's wrong with my script? > > > Error Message: > > c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > > active_support/dependencies.rb:442:in `load_missing_constant': > > uninitialized constant Watir::Container::TextField (NameError) > > from > > c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > > active_support/dependencies.rb:77:in `const_missing' > > from c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > > container.rb:275:in `text_field' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: uninitialized constant Watir::Container::TextField (NameError)
Hi Martin: I am not sure whether it because you missed install process c:\>gem install windows-pr for more information please refer to http://wiki.openqa.org/display/WTR/Install+Watir Thanks! Bill On Wed, Feb 11, 2009 at 4:58 PM, Martin wrote: > > C:\>gem update --system > Updating RubyGems > Nothing to update > > C:\>gem install watir > Successfully installed watir-1.6.2 > 1 gem installed > Installing ri documentation for watir-1.6.2... > Installing RDoc documentation for watir-1.6.2... > > My script: > require 'watir' > include Watir > Watir::Browser.default = 'ie' > $ie = Browser.new > #Open yahoo mail. > $ie.goto("http://mail.yahoo.com";) > > #Put your user name. > $ie.text_field(:name,"login").set("User_Name") > $ie.text_field(:name, "login").set("User_Name") > #Put your password. > $ie.text_field(:name,"passwd").set("Password") > > #Click Sign In button. > $ie.button(:value,"Sign In").click > > #Click Sign Out button. > $ie.link(:text, "Sign Out").click > > #Close the browser. > $ie.close > > > When I run it, I got uninitialized constant > Watir::Container::TextField (NameError). > > Does anyone know what's wrong with my script? > > > Error Message: > c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:442:in `load_missing_constant': > uninitialized constant Watir::Container::TextField (NameError) >from > c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:77:in `const_missing' >from c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > container.rb:275:in `text_field' > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---
[wtr-general] Re: uninitialized constant Watir::Container::TextField (NameError)
Rewrite the first section: require 'watir' include Watir Watir::Browser.default = 'ie' $ie = Browser.new as require 'watir' Watir.Browser.default = 'ie' # Not really needed on Windows as 'ie' is always the default anyway... $ie = Watir::Browser.new works fine for me that way - though I do get a number of issues if I use "include Watir" and set up my browser object as Browser.new like you originally did... Regards, John On Feb 11, 8:58 am, Martin wrote: > C:\>gem update --system > Updating RubyGems > Nothing to update > > C:\>gem install watir > Successfully installed watir-1.6.2 > 1 gem installed > Installing ri documentation for watir-1.6.2... > Installing RDoc documentation for watir-1.6.2... > > My script: > require 'watir' > include Watir > Watir::Browser.default = 'ie' > $ie = Browser.new > #Open yahoo mail. > $ie.goto("http://mail.yahoo.com";) > > #Put your user name. > $ie.text_field(:name,"login").set("User_Name") > $ie.text_field(:name, "login").set("User_Name") > #Put your password. > $ie.text_field(:name,"passwd").set("Password") > > #Click Sign In button. > $ie.button(:value,"Sign In").click > > #Click Sign Out button. > $ie.link(:text, "Sign Out").click > > #Close the browser. > $ie.close > > When I run it, I got uninitialized constant > Watir::Container::TextField (NameError). > > Does anyone know what's wrong with my script? > > Error Message: > c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:442:in `load_missing_constant': > uninitialized constant Watir::Container::TextField (NameError) > from c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/ > active_support/dependencies.rb:77:in `const_missing' > from c:/rails2.1/ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ > container.rb:275:in `text_field' --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~--~~~~--~~--~--~---