我有一个黄瓜测试套件,我正在运行,每当我调用browser.close方法时,它都会抛出以下错误
C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:
initialize': No connection could be made because the target machine actively refused it. - connect(2) (Errno::ECONNREFUSED) from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in
打开' 来自C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:在block in connect' from C:/Ruby193/lib/ruby/1.9.1/timeout.rb:54:in
超时' 来自C:/Ruby193/lib/ruby/1.9.1/timeout.rb:99:intimeout' from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:762:in
connect' 来自C:/Ruby193/lib/ruby/1.9.1/net/http.rb:755:在do_start' from C:/Ruby193/lib/ruby/1.9.1/net/http.rb:744:in
开始' 来自C:/Ruby193/lib/ruby/1.9.1/net/http.rb:1284:在request' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/http/default.rb:83:in
response_for' 来自C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/http/default.rb:39:inrequest' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/http/common.rb:40:in
来电&# 39; 来自C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/bridge.rb:634:在raw_execute' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/bridge.rb:612:in
执行' 来自C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/remote/bridge.rb:200:quit' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/ie/bridge.rb:59:in
退出' 来自C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.40.0/lib/selenium/webdriver/common/driver.rb:168:inquit' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.8/lib/watir-webdriver/browser.rb:136:in
close' 来自D:/Workspaces/Ruby/RegressionTesting/features/support/env.rb:60:在`block in>中'
仅当浏览器是IE时才会发生这种情况。具体来说,我正在使用IE 11进行测试。这可以通过在IRB中运行以下代码来重新创建
require 'watir-webdriver'
@browser = Watir::Browser.new :ie
@browser.close
我的所有测试场景都很好,这只有在我调用at_exit中的browser.close方法时才会发生。这只是一个令人讨厌的问题...任何想法?
答案 0 :(得分:0)
我认为不支持Internet Explorer 11。来自selenium-developers Google group:
IE 11支持继续受到浏览器行为变化的阻碍。 微软的解决方案不太可能即将推出,因为 最近公布了一个过程中的开发 用于Internet Explorer 11及更高版本的Microsoft编写的驱动程序。注意 微软的驱动程序将无法以任何形式提供,直到 WebDriver的W3C规范在规范中进一步发展 处理。此外,没有宣布发布的时间表 微软,也不应该期待。