hi consider your program

def mymethod
b = Watir::Browser.new
b.goto 'www.purple.com'
b.close
return true
rescue Timeout::Error
puts "Page load timed out"
return false
rescue => e
puts e
return false
ensure
b.close rescue nil
end

10.times do |iteration|
unless mymethod
puts "Error occurred, terminating process"
exit
else
puts "Succeeded: #{iteration}"
end
end

This program opens the browser by executing the statement
b.open "www.purple.com" and then it immediately closes the browser 
regardless of loading status of the browser. That means it executes the 
statement www.purple.com  and once browser open operation has been 
triggered, it just executes next statement b.close. But it should not be 
the case right? Because it has to wait until browser gets opened and 
then it has to go to the next statement, So it could calculate the time 
taken by the browser to open and if it exceeds the time limit ,then it 
can direct the execution control inside

"rescue Timeout::Error
puts "Page load timed out"
return false"

So Is it a wrong program for Timeout, Or did i misunderstand?

RAJ

-- 
Posted via http://www.ruby-forum.com/.