Great thanks. That's got rid of the error message, but it still appears to be
running through twice and therefore stopping midway through.
The 'sign in' click takes you through to sign in page.
Th continue button should cause the alert to appear.
I then need to capture the text within the popup.
Then select ok to deal with alert.
Then finally close IE.
What appears to be happening is
The 'sign in' click takes you through to sign in page.
Th continue button should cause the alert to appear.
the jsalert_clicker selects the ok to deal with the alert
I need to manually select the continue button again which causes the alert to
appear again
the capureText extracts the text (text = autoit.WinGetText "Windows Internet
Explorer", "") and also deals with the alert (autoit.Send "{ENTER}").
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 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 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
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