Hi Brett,

I'm basically trying to run multiple instance of the
following script (the original is a bit larger because
I kept repeating the steps). 

The example below uses winclicker to launch "1.html"
and attach to it. I tested this by creating two
versions and changing the page to "2.html" in the
second version. This failed. What DOES seem to work is
using something like "ie2 = IE.new") in the second
file. That, along with using winclicker to attach to
unique windows, seemed to do it.

Thanks

John

#------------
require 'watir'
require 'watir/winClicker'
include Watir
require 'test/unit'
require 'unittests/config' #Contains just the $url
param right now 

$LOAD_PATH.unshift File.join(File.dirname(__FILE__),
'..') if $0 == __FILE__

class TC_login < Test::Unit::TestCase

w=WinClicker.new
w.winsystem("start explorer 1.html")
sleep 4
ie = IE.attach(:title , "1")

def test_login
ie = IE.new
ie.set_slow_speed 
ie.goto($url)
ie.text_field(:name, "ln_name").set("foo")
ie.button(:value, "Login").click
assert(ie.contains_text("User name foo or password is
invalid."))             

ie.goto($url)
ie.text_field(:name, "ln_name").set("root")
ie.text_field(:name, "ln_password").set("password")
ie.button(:value, "Login").click
assert(ie.contains_text("Daily Data Collection"))               
ie.link(:text, "Logout").click

ie.close

end

end
#------------



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to