【发布时间】:2013-04-19 07:52:30
【问题描述】:
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
这是我的 php 文件:http: //localhost/test/test.php
<?php
set_time_limit(90);
sleep(60);
echo "hello"
?>
输出->超时,之后报错:
Errno::ECONNREFUSED(无法建立连接,因为目标机器主动拒绝了它。- connect(2))。
基本上它应该在超时后关闭ie然后再次打开ie等等
【问题讨论】:
-
如果将浏览器指向 localhost/test/test.php 会发生什么?
-
它应该打印超时然后关闭浏览器,然后从头开始重试。
-
为什么?这一定是我见过有人尝试自动化的最奇怪的事情之一
-
解决这个问题的方法是什么?
标签: ruby watir watir-webdriver