I installed the new gem 1.5.1.1100 and wanted to test creating separate IE processes.
I took the googleSearch.rb script and added the require statement for the new capabilities as well as changing the Watir:IE.new line to Watir:IE.new_process, and adding an ie.kill at the end.

What happpened was that a new browser window appears and the script stops at the new_process line.
The debug line prints a process id which I cannot find as a running process on my system.
I can only regain control of my command line by hitting CTRL-C and then I get the following stack trace:

C:\Documents and Settings\Administrator\My Documents\Watir Project\1.5.1.bonus\examples>ruby googleSearch_newprocess.rb
Process ID: 7480
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/contrib/ie-new-process.rb:44:in `window': Interrupt
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/contrib/ie-new-process.rb:43:in `window'
        from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir/contrib/ie-new-process.rb:67:in `new_process'
        from googleSearch_newprocess.rb:23

Seems as if the system is trying to attach to a process that is no longer there and so hangs.
I am on WinXP and running IE 6.0.2900.2180.on SP2.

Am I doing something incorrectly?
Is this a defect that needs to be investigated?


#-------------------------------------------------------------------------------------------------------------#
# demo test for the WATIR controller                                          
#                                                                              
#  Simple Google test written by Jonathan Kohl   10/10/04                      
# Purpose: to demonstrate the following WATIR functionality:                  
#   * entering text into a text field                                          
#   * clicking a button
#   * checking to see if a page contains text.                                
# Test will search Google for the "pickaxe" Ruby book
#
#------------------------------------------------------------------------------------------------------------#

   require 'watir'   # the watir controller
   require 'watir/contrib/ie-new-process'   # test for creating in new process
   
   # set a variable
   test_site = 'http://www.google.com'
 
   # open the IE browser
   # ie = Watir::IE.new
   ie = Watir::IE.new_process

   # print some comments
   puts "## Beginning of test: Google search"
   puts "  "
 
   puts "Step 1: go to the test site: " + test_site
   ie.goto(test_site)
   puts "  Action: entered " + test_site + " in the address bar."

   puts "Step 2: enter 'pickaxe' in the search text field"
   ie.text_field(:name, "q").set("pickaxe")       # q is the name of the search field
   puts "  Action: entered pickaxe in the search field"

   puts "Step 3: click the 'Google Search' button"
   ie.button(:name, "btnG").click   # "btnG" is the name of the Search button
   puts "  Action: clicked the Google Search button."

   puts "Expected Result: "
   puts " - a Google page with results should be shown. 'Programming Ruby' should be high on the list."
 
   puts "Actual Result: Check that the 'Programming Ruby' link appears on the results page "
   if ie.text.include?("Programming Ruby")  
      puts "Test Passed. Found the test string: 'Programming Ruby'. Actual Results match Expected Results."
   else
      puts "Test Failed! Could not find: 'Programming Ruby'"
   end
   
   puts "  "
   puts "## End of test: Google search"
 
  ie.kill
 
# -end of simple Google search test



Scott

"The supreme misfortune is when theory outstrips performance."

- Leonardo da Vinci

Scott Snyder
WPLC Performance


_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to