require 'watir-webdriver'
begin
url='http://localhost/test/test.php'
ie =Watir::Browser.new:chrome
ie.goto url
rescue Timeout::Error
puts "time out"
ie.close
retry
end
This my php file:http: //localhost/test/test.php
<?php
set_time_limit(90);
sleep(60);
echo "hello"
?>
output -> time-out, and after it error:
Errno::ECONNREFUSED (No connection could be made because the target machine actively refused it. - connect(2)).
Basically it should close the ie after time out and then again open ie and so on