What you are trying to do can't be done with the version of Watir.rb you
are using because the page you are trying to attach to is a Modal
window.  Try this one at:
https://svn.openqa.org/svn/watir/branches/modal_dialog/watir/ (you will
also need the files from the Watir folder--the IEDialog and Win32ole
forders.)

Copy the Watir.rb file (and the watir directory mentioned above) into
you ruby installation directory like:
C:\ruby\lib\ruby\site_ruby\1.8

ie2 = $ie.attach_modal('Project - Administration')

ie2.button(:value, "Cancel").click

--Mark

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ken Perez
Sent: Monday, July 17, 2006 12:47 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Attaching a Popup

The app that I am working with has a lot of popups with important
functionality on them.  I have been unsuccessful in getting Watir to see
these new windows, and I cant figure out why.  The window Im looking at
now appears after a button click:
 
ie.button(:name, "addItem").click
 
and Ive tried all these variations to get it to work:
 
ie2 = Watir::IE.attach(:title, "Project - Administration -- Web Page
Dialog")
ie2 = Watir::IE.attach(:title, "Project - Administration")
ie2 = Watir::IE.attach(:title, /Project/)
ie2 = Watir::IE.attach(:title, /project/)
ie2 = Watir::IE.attach(:url, "website list at the bottom of the new
window")
ie2 = Watir::IE.attach(:url, "website found in the properties of the
button")
ie2 = Watir::IE.attach(:url, /Project/)
ie2 = Watir::IE.attach(:url, /project/)
 
plus a few others, followed by
 
ie2.button(:value, "Cancel").click
 
to see if it worked.
 
It either gives me 'Unable to locate a window with X' (#'s 5 & 6) or it
does nothing (most of the rest of them).  When it gets to the window, it
just sits and waits, and when I click Cancel it stops the run, and exits
with no errors.  So its not finding the window, but not giving me any
errors.  
 
I use Starclicker to deal with 'Are you sure Y/N' popups, but I have to
actually edit things in these popups.  Is there another way to attach a
window, or use functionality on it?  
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to