[wtr-general] Re: Watir Install/Basic Error, It doesn't launch browser
I found the answer. With the new version I need to use ie=Watir::IE.new not include Watir. On Aug 3, 7:04 pm, Dylan mej...@gmail.com wrote: I would try uninstall/reinstalling and running gem update --system beforehand so you have the latest version of rubygems before you try installing watir. I promise nothing, though! :) -Dylan On Aug 2, 8:12 pm, DF df.tra...@gmail.com wrote: I am totally new and just trying to learn and do basic staff. I installed RC2 Ruby and Watir. ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] While running gem install watir got this error: Installing ri documentation for builder-2.1.2... ERROR: While generating documentation for builder-2.1.2 ... MESSAGE: Unhandled special: Special: type=17, text=!-- HI -- ... RDOC args: --ri --op C:/Ruby/lib/ruby/gems/1.8/doc/builder-2.1.2/ ri --title Builder -- Easy XML Building --main README --line-numbers --quiet lib CHANGES Ra kefile README doc/releases/builder-1.2.4.rdoc doc/releases/ builder-2.0.0.rdoc do c/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation (continuing with the rest of the installation) Overall I thought it installed. Then I tried to run Marick's script from his book: watir.rb --- # Excerpted from Everyday Scripting in Ruby # We make no guarantees that this code is fit for any purpose. # Visithttp://www.pragmaticprogrammer.com/titles/bmsftformore book information. #--- require 'test/unit' require 'watir' include Watir # You don't need to understand this to understand the test. # See the chapter on modules if you want to. class WatirExample Test::Unit::TestCase def test_marick_vanity ie = IE.new # Launch Internet Explorer ie.goto('http://www.google.com') irb # If you view the HTML source, you can see that Google # names the search field 'q'. ie.text_field(:name, q).set(scripting for testers) # 'btnI' is the name of the I'm Feeling Lucky button. ie.button(:name, btnI).click # Case-insensitive search for my name. assert(ie.contains_text(/marick/i)) end end And I got these errors: C:\Rubyc:\Test\RubyBook\code\scraping-alternatives\watir.rb Loaded suite c:/Test/RubyBook/code/scraping-alternatives/watir Started E Finished in 2.484 seconds. 1) Error: test_marick_vanity(WatirExample): MissingSourceFile: no such file to load -- safariwatir C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `const_get' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `local_constants' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `each' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `local_constants' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:68:in `each' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:68:in `local_constants' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:86:in `local_constant_names' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:498:in `new_constants_in' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:495:in `collect' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:495:in `new_constants_in' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:156:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support.rb:57 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_origina l_require' C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ non_control_elements.rb :1 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_origina l_require' C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:82 c:/Test/RubyBook/code/scraping-alternatives/watir.rb:14:in `test_marick_vani ty' 1 tests, 0 assertions, 0 failures, 1 errors It didn't even open the browser. Then I started to run from irb with step by step script: irb(main):002:0 require 'watir' = true irb(main):003:0 test_site=http://www.google.com; = http://www.google.com; irb(main):004:0 ie=Watir::IE.new = #Watir::IE:0x2c0a498 @rexmlDomobject=nil, @logger=#Watir::DefaultLogger:0x2 bb1ce4 @level=2,
[wtr-general] Re: Watir Install/Basic Error, It doesn't launch browser
I would try uninstall/reinstalling and running gem update --system beforehand so you have the latest version of rubygems before you try installing watir. I promise nothing, though! :) -Dylan On Aug 2, 8:12 pm, DF df.tra...@gmail.com wrote: I am totally new and just trying to learn and do basic staff. I installed RC2 Ruby and Watir. ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] While running gem install watir got this error: Installing ri documentation for builder-2.1.2... ERROR: While generating documentation for builder-2.1.2 ... MESSAGE: Unhandled special: Special: type=17, text=!-- HI -- ... RDOC args: --ri --op C:/Ruby/lib/ruby/gems/1.8/doc/builder-2.1.2/ ri --title Builder -- Easy XML Building --main README --line-numbers --quiet lib CHANGES Ra kefile README doc/releases/builder-1.2.4.rdoc doc/releases/ builder-2.0.0.rdoc do c/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation (continuing with the rest of the installation) Overall I thought it installed. Then I tried to run Marick's script from his book: watir.rb --- # Excerpted from Everyday Scripting in Ruby # We make no guarantees that this code is fit for any purpose. # Visithttp://www.pragmaticprogrammer.com/titles/bmsftfor more book information. #--- require 'test/unit' require 'watir' include Watir # You don't need to understand this to understand the test. # See the chapter on modules if you want to. class WatirExample Test::Unit::TestCase def test_marick_vanity ie = IE.new # Launch Internet Explorer ie.goto('http://www.google.com') irb # If you view the HTML source, you can see that Google # names the search field 'q'. ie.text_field(:name, q).set(scripting for testers) # 'btnI' is the name of the I'm Feeling Lucky button. ie.button(:name, btnI).click # Case-insensitive search for my name. assert(ie.contains_text(/marick/i)) end end And I got these errors: C:\Rubyc:\Test\RubyBook\code\scraping-alternatives\watir.rb Loaded suite c:/Test/RubyBook/code/scraping-alternatives/watir Started E Finished in 2.484 seconds. 1) Error: test_marick_vanity(WatirExample): MissingSourceFile: no such file to load -- safariwatir C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `const_get' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `local_constants' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `each' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:70:in `local_constants' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:68:in `each' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:68:in `local_constants' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/core_e xt/module/introspection.rb:86:in `local_constant_names' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:498:in `new_constants_in' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:495:in `collect' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:495:in `new_constants_in' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support/depend encies.rb:156:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/ active_support.rb:57 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_origina l_require' C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ non_control_elements.rb :1 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_origina l_require' C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/ie.rb:82 c:/Test/RubyBook/code/scraping-alternatives/watir.rb:14:in `test_marick_vani ty' 1 tests, 0 assertions, 0 failures, 1 errors It didn't even open the browser. Then I started to run from irb with step by step script: irb(main):002:0 require 'watir' = true irb(main):003:0 test_site=http://www.google.com; = http://www.google.com; irb(main):004:0 ie=Watir::IE.new = #Watir::IE:0x2c0a498 @rexmlDomobject=nil, @logger=#Watir::DefaultLogger:0x2 bb1ce4 @level=2, @formatter=#Logger::SimpleFormatter:0x2bb0f9c @datetime_format =%d-%b-%Y %H:%M:%S, @default_formatter=#Logger::Formatter: 0x2bb1ca8 @datetim e_format=nil, @progname=nil, @logdev=#Logger::LogDevice:0x2bb18c0 @mutex=#Log ger::LogDevice::LogDeviceMutex:0x2bb1730