Re: [Wtr-general] WAIT statement didn't wait?
Actually, ie.wait(true) would do the same thing. Here is the code for Frame#wait: def wait(no_sleep = false) @container.wait(no_sleep) end It simply passes the wait call up to the container of the frame (the ie object). What wait does is wait for the page to finish loading; it automatically checks sub frames. It sounds like what you want to do is wait until a particular object exists. We don't have anything like that in Watir. Bret At 07:12 PM 8/26/2005, Tuyet Cong-Ton-Nu wrote: Just so you know, this doesn't do what you think: ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent) It's actually the same as ie.frame(main).frame(sidebar).wait(true) Hmm! So the statement I used is actually is checking to see if the sidebar is there and NOT the analysisSideBarTabContent ? Should I use this then for the analysisSideBarTabContent? ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).wait(true) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] WAIT statement didn't wait?
Just so you know, this doesn't do what you think: ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent)It's actually the same as ie.frame(main).frame(sidebar).wait(true) Hmm! So the statement I used is actually is checking to see if the sidebar is there and NOT the analysisSideBarTabContent? Should I use this then for the analysisSideBarTabContent? ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).wait(true) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] WAIT statement didn't wait?
OK, thanks, Bret for the suggestion. Per your request, here are some additional lines of code that preceded the while statement. There is the attach statement which may be causing the problem since you had opened up a bug on that a couple of days ago? ie.frame(:name, portfolioTreeContent).frame(:name, treeframe).link(:text, /MMIM/).click sleep 3 ie = Watir::IE.attach(:url, https://test.com/araneae/app) #Reconnect back to main frame ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent) sleep 3 while !ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src, /icon_report_positions.gif/).exists? sleep 0.1 end ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src, /icon_report_positions.gif/).click ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] WAIT statement didn't wait?
Tx for the info. Just so you know, this doesn't do what you think: ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent) It's actually the same as ie.frame(main).frame(sidebar).wait(true) The fix regarding wait and attach is in 1.4., so this may be a new problem. Bret At 12:46 PM 8/23/2005, Tuyet Cong-Ton-Nu wrote: OK, thanks, Bret for the suggestion. Per your request, here are some additional lines of code that preceded the while statement. There is the attach statement which may be causing the problem since you had opened up a bug on that a couple of days ago? ie.frame(:name, portfolioTreeContent).frame(:name, treeframe).link(:text, /MMIM/).click sleep 3 ie = Watir::IE.attach(:url, https://test.com/araneae/app;) #Reconnect back to main frame ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent) sleep 3 while !ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src, /icon_report_positions.gif/).exists? sleep 0.1 end ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src, /icon_report_positions.gif/).click ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] WAIT statement didn't wait?
The fact that you have to mess with all of this is probably a bug in the wait method. Can you give us more info on what preceeds this code? In the mean time, this should do what you want: ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent) sleep 3 until (begin ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src,/icon_report_positions.gif/).exists? rescue UnknownFrameException false end) do sleep 0.1 end ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src, /icon_report_positions.gif/).click At 06:51 PM 8/22/2005, Tuyet Cong-Ton-Nu wrote: I used both the WAIT command and a loop with a sleep statement but they both didn t wait or sleep long enough ? Here is the code: ie.frame(main).frame(sidebar).wait(analysisSidebarTabContent) sleep 3 while !ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src,/icon_report_positions.gif/).exists? sleep 0.1 end ie.frame(main).frame(sidebar).frame(analysisSidebarTabContent).image(:src, /icon_report_positions.gif/).click Even with the WAIT command and the sleep command after the WAIT, I got this error on line 110 which is the while statement: 1) Error: test_a_analysis1(TC_Analysis): Watir::Exception::UnknownFrameException: Unable to locate a frame with name analysisSidebarTabContent c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1739:in `initialize' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:222:in `new' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:222:in `frame' C:/watir/Analysis.rb:110:in `test_a_analysis1' 1 tests, 1 assertions, 0 failures, 1 errors ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general _ Bret Pettichord www.pettichord.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general