[Wtr-general] PopUp window problem
Duke
forum-watir-users at openqa.org
Tue Mar 6 17:49:29 EST 2007
If we're not dealing with a modal dialog, but an actual new window, often Watir doesn't wait correctly since it's only worrying about whether the current window is done loading, not what the pop-up is doing. Here's my fix:
def get_popup(how, what)
tries = 100
popup = nil
until popup do
begin
sleep(0.1)
popup = IE.attach(how, what)
rescue => e
raise e if (tries -= 1) <= 0
end
end
popup
end
@ie_popup_window = get_popup(:title, /Drive Admin/)
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6726&messageID=19599#19599
More information about the Wtr-general
mailing list