Hi still no luck I'm afraid, this is the closest I can get to what I want but 
with odd behaviour. 

For some reason the first alert does not appear to be recognised, but if I 
select this manually and then select the continue button again then the script 
kicks in again, extracts the text, puts the text out to the console, and then 
closes the alert as per the script. I'm just struggling to understand why it's 
not recognised the first time round. Any ideas? See script below:

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", ""
  text = autoit.WinGetText "Windows Internet Explorer", ""
  puts text.to_s
  autoit.Send "{enter}"
end  


def test_1
  @IE0 = IE.new
  @IE0.set_fast_speed
  @IE0.goto("www.hmv.co.uk")
  @IE0.link(:text, "Sign In").click
  @IE0.image(:alt, "continue").click
  captureText
  
  @IE0.close                                                   
  end
end
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to