|
|
|
I'm suffering from sporadic Watir hang ups, added some logging to ie.rb and found that it hangs if frame with about:blank appears. As a temporary workaround I hacked ie.rb
while doc = documents_to_wait_for.shift begin until doc.readyState == "complete" or doc.readyState == "uninitialized" do Not sure if this conforms project coding style but I believe it's better to skip such a frames rather than wait on them. |
|||||||||||||||||||||||||||||||||||||||||||||
i have tested the below code successfully when the page is stuck loading continuously.
This should timeout when ie is loading for more than 30 secs.
Also a method could be added to set the timeout.
The timeout in watir and firewatir would have to be set to the same value.
def wait(no_sleep=false)
@rexmlDomobject = nil
@down_load_time = 0.0
a_moment = 0.2 # seconds
start_load_time = Time.now
@tcount = 150 if @tcount.nil? ## -- this is the calculated count ... numofsecs/a_moment (150 = 30 secs)ss
acount=1
begin
while @ie.busy && acount < @tcount# XXX need to add time out
#puts "WAITING@@@@@@@@ #{acount}"
acount += 1
sleep a_moment
end
raise "Timeout Exception : Timeout after #{acount * a_moment}secs" if acount == @tcount
... the remaing code in wait method.
def setTimeOut(val=30) #mention the number of seconds
@tcount = val/0.2 ## -- this 0.2 is supposed to be a_moment
end
-Tony