This code works for minimize and background IE browsers... Is there a
way to turn background on/off in the middle of a script??
require 'watir'
include Watir
class IE
def exists?
begin
@ie.hWnd== -1
return true
rescue
return false
end
end
end
if __FILE__ == $0
require 'test/unit'
class TC_ie < Test::Unit::TestCase
def test_open
$ie=IE.new
assert($ie.exists?)
$ie.close
end
def test_close
$ie=IE.new
$ie.close
sleep 0.1 # the browser takes some time to close
assert(!$ie.exists?)
end
def test_minimize
$ie=IE.new
$ie.goto("http://www.google.ca") # can't minimize a
blank window because it throws an error
$ie.minimize
assert($ie.exists?)
$ie.close
end
def test_invisible_open
command_line_flag('-b') # this doesn't work the way I want
$ie=IE.new
assert($ie.exists?)
$ie.close
end
end
end
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general