OK, now here's the latest update. Once again any help would be greatly 
appreciated as I'm having difficulty in extracting the text from an alert. 
Coming from a qa background rather than developer, I feel like a fish out of 
watir.
Anyway,

I've figured out how to deal with the script halting part way through but now I 
am no longer getting the text in the alert but a '1' instead:

require 'watir'   # the controller
include Watir
require 'watir/WindowHelper'

require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'dl/win32'
require 'watir/winClicker'

class TC_recorded < Test::Unit::TestCase

def captureText
  autoit = WIN32OLE.new('AutoItX3.Control')
  ret = autoit.WinWait "Windows Internet Explorer", "", 1
  text = autoit.WinGetText "Windows Internet Explorer"
  puts text.to_s
  autoit.Send "{ENTER}"
end

def start_jsalert_clicker

Thread.new{ system("ruby 
\"C:\\ruby\\lib\\ruby\\gems\\1.8\\gems\\watir-1.5.1.1164\\unittests\\jscriptExtraAlert.rb\"")
 }

end

def test_1
  @IE0 = IE.new
  @IE0.set_fast_speed
  @IE0.goto("www.hmv.co.uk")
  @IE0.link(:text, "Sign In").click
  start_jsalert_clicker
  @IE0.image(:alt, "continue").click
  captureText

  @IE0. close
  end
end
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to