This is a bug. Please go ahead and log it on our bug tracker.

Attach should wait a reasonable amount of time for a new window to appear. It should attach to the window when it appears, or else fail after a reasonable amount of time has passed.

(BTW, IE#wait should also fail after a reasonable amount of time has passed. Right now it waits forever.)

What is reasonable? The default should probably be about 5 seconds. It should be set as a configurable option.

To date, we have attached these kinds of configurable options to a particular IE object. That approach won't work here, because the IE object doesn't exist until IE#attach has returned.

(I've been wanting to set up configuration options as a separate object for a while. This situation should be taken into account.)

Bret

At 03:46 AM 8/20/2005, Zeljko Filipin wrote:
"urn:schemas-microsoft-com:office:office" xmlns:w = "urn:schemas-microsoft-com:office:word">
I have the same problem, but I have not found the solution yet.

Zeljko


----------
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tuyet Cong-Ton-Nu
Sent: Saturday, August 20, 2005 1:06 AM
To: [email protected]
Subject: [Wtr-general] Sleep statements and Attach

The code below, for example, is a typical thing that I have to do in our application.

1)       Click on an icon to launch the Select Portfolio window

2) The problem is that it may take the Select Portfolio window a little while to load,

so I have to add a Sleep parameter otherwise, the attach statement will fail because it can t find the title

3)       Is there a way to do this without using the Sleep statements?

4) Also once I am done with this Select Portfolio, I close it, and need to reconnect back to the main window of the application to continue with the script and there again I have to put a Sleep statement.

5)       Any help/suggestion you have to handle this is appreciated



ie.frame("main").frame(:name, "context_bar").image(:src, /icon_open.gif/).click

            sleep 3

      ie = Watir::IE.attach(:title, "Select Portfolio")



            #Reconnect back to main frame

            sleep 3

            ie = Watir::IE.attach(:url, "https://test.com/araneae/app";)
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_____________________
 Bret Pettichord
 www.pettichord.com

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to