我有一套针对我们的网络应用程序执行的黄瓜脚本。当我针对 IE8 和 Chrome 运行脚本时,它们运行良好,但在关闭浏览器时却不能。
这是我得到的堆栈跟踪:
Errno::ECONNREFUSED:连接被拒绝 - 连接被拒绝
initialize at org/jruby/ext/socket/RubyTCPSocket.java:122
open at org/jruby/RubyIO.java:1179
connect at C:/jruby-1.7.2/lib/ruby/1.9/net/http.rb:762
timeout at org/jruby/ext/timeout/Timeout.java:105
connect at C:/jruby-1.7.2/lib/ruby/1.9/net/http.rb:762
do_start at C:/jruby-1.7.2/lib/ruby/1.9/net/http.rb:755
start at C:/jruby-1.7.2/lib/ruby/1.9/net/http.rb:744
start at C:/jruby-1.7.2/lib/ruby/1.9/net/http.rb:743
request at C:/jruby-1.7.2/lib/ruby/1.9/net/http.rb:1292
request at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51
response_for at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/default.rb:83
request at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/default.rb:39
call at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/http/common.rb:40
raw_execute at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:619
execute at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:597
quit at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/remote/bridge.rb:193
quit at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/chrome/bridge.rb:48
quit at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/selenium-webdriver-2.32.1/lib/selenium/webdriver/common/driver.rb:168
close at C:/jruby-1.7.2/lib/ruby/gems/shared/gems/watir-webdriver-0.6.2/lib/watir-webdriver/browser.rb:135
(root) at C:/Users/explorys/Documents/workspace/qa-cucumber/features/support/hooks.rb:25
- 我们在脚本中使用 jruby。
下面是关闭浏览器的代码:
at_exit do
if !browser.nil?
browser.close
end
end
以下是宝石列表:
活动模型(3.2.13、3.2.12)
活动记录(3.2.12)
activerecord-jdbc-适配器 (1.2.2.1)
activerecord-jdbcmysql-适配器 (1.2.2.1)
主动支持(3.2.13、3.2.12)
雷尔 (3.0.2)
建设者(3.0.4)
子进程(0.3.8)
普通人 (4.0.0)
复合主键 (5.0.12)
黄瓜 (1.2.1)
diff-lcs (1.2.1, 1.1.3)
更快的csv(1.5.5)
ffi (1.3.1 java)
小黄瓜(2.11.6 java)
hbase-jruby (0.2.2 java)
i18n (0.6.1)
jdbc-mysql (5.1.22.1)
jruby-win32ole (0.8.5)
json (1.7.7 java)
线缓存(0.46 java)
哑剧类型 (1.22)
multi_json (1.6.0)
耙子 (10.0.2)
休息客户端(1.6.7)
rspec (2.12.0)
rspec 核心 (2.12.2)
rspec-expectations (2.12.1)
rspec 模拟 (2.12.2)
ruby-debug-base (0.10.5.rc3 java)
ruby-debug-ide (0.4.17.beta17, 0.4.17.beta16)
rubyzip (0.9.9)
硒网络驱动程序(2.32.1、2.29.0)
系统名称 (0.9.1)
tzinfo (0.3.35)
水 (4.0.2)
水网驱动程序(0.6.2)
网络套接字(1.0.7)
win32 进程 (0.7.2)
xml 对象 (0.9.93)
xml-简单 (1.1.2)