SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: help in watir

  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question help in watir

    hi
    I have installed Ruby 1.8.5-21 and also installed the watir 1.5.0 gem.
    when i use the run the below program
    Operating Systems :Windows XP
    Code:
    require 'watir' #i get the below error
     # use watir gem 
     test_site = 'http://www.google.com'      # set a variable
     ie =Watir::IE.new                     # open the IE browser
     ie.goto(test_site)                       # load url, go to site
     ie.text_field(:name, "q").set("pickaxe") # load text "pickaxe" into search field named "q"
     ie.button(:name, "btnG").click           # "btnG" is the name of the Search button, click it
     
     if ie.text.include?("Programming Ruby")  
       puts "Test Passed. Found the test string: 'Programming Ruby'."
     else
       puts "Test Failed! Could not find: 'Programming Ruby'" 
     end
    i get the below error.



    ./watir.rb:4: uninitialized constant Watir (NameError)
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
    from watir.rb:2
    >Exit code: 1

    please tell me how to prevent this error.

    Thanks in Advance
    K Sathya Narayanan
    Last edited by sathya_k_83; May 30, 2008 at 03:20.

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    probably

    gem 'watir'
    require 'watir'
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •