mihai wrote:
> i have a link in $ie wich opens me a new window 
> i attach that window to a variable $ie1 like that: $ie1=IE.attach(:title, 
> /bla bla bla/) and i must verify if that window really exist or not
> how do i do that because if that window exist is ok, but if is not exist the 
> script is interrupted and stoped and i dont want that: 
> c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1192/./watir.rb:1642:in 
> `attach_browser_window': Unable to locate a window with title of (?-mix:bla 
> bla bla) (Watir::Exception::NoMatchingWindowFoundException)
>   
Instead of "attach" use the "find" method -- it will return false (not 
raise an exception) if it cannot find a window with the specified name. 
Thus:

$ie1 = IE.find(:title, /blah/)
print 'window not found' unless $ie1
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to