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
[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