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.
# Visit http://www.pragmaticprogrammer.com/titles/bmsft for 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:\Ruby>c:\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 @mon_entering_queue=[],
@mon_count=0, @
mon_owner=nil, @mon_waiting_queue=[]>, @dev=#<IO:0x2846adc>,
@shift_size=nil, @s
hift_age=nil, @filename=nil>>, @down_load_time=0.328, @type_keys=true,
@speed=:s
low, @ie=#<WIN32OLE:0x2bb261c>, @url_list=["about:blank"],
@typingspeed=0.08, @p
ause_after_wait=0.1, @error_checkers=[], @page_container=#<Watir::IE:
0x2c0a498 .
..>, @activeObjectHighLightColor="yellow", @ole_object=nil>
irb(main):005:0> ie.goto test_site
=> 0.562
irb(main):006:0>

It opened browser and went to google.

Can someone explain and help? Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to