为什么jruby / selenium会丢失我与浏览器的连接

时间:2014-02-05 21:59:13

标签: selenium cucumber jruby watir-webdriver

我正在进行软件升级,我遇到了测试开始运行的问题,但是突然之后浏览器会停止响应,我得到以下堆栈跟踪:

我正在使用黄瓜(1.3.10),小黄瓜(2.12.2-java),页面对象(0.9.5),watir-webdriver(0.6.6)和selenium-webdriver(2.39.0)使用firefox和chrome with Ruby 1.9.3

在使用黄瓜(1.2.3),watir-webdriver(0.6.2)和selenium-webdriver(2.34.0)与红宝石1.8.7之前我没有遇到过这个问题

Unable to establish loopback connection

org/jruby/RubyIO.java:3673:in `select'
C:/jruby-1.7.10/lib/ruby/1.9/net/protocol.rb:143:in `rbuf_fill'
C:/jruby-1.7.10/lib/ruby/1.9/net/protocol.rb:141:in `rbuf_fill'
C:/jruby-1.7.10/lib/ruby/1.9/net/protocol.rb:122:in `readuntil'
C:/jruby-1.7.10/lib/ruby/1.9/net/protocol.rb:132:in `readline'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:2570:in `read_status_line'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:2559:in `read_new'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1327:in `transport_request'
org/jruby/RubyKernel.java:1282:in `catch'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1324:in `transport_request'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1301:in `request'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1294:in `request'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:745:in `start'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:743:in `start'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1292:in `request'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/rest-client-1.6.7/lib/restclient/net_http_ext.rb:51:in `request'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/default.rb:83:in `response_for'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/default.rb:39:in `request'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:634:in `raw_execute'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:612:in `execute'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/remote/bridge.rb:545:in `isElementEnabled'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/selenium-webdriver-2.39.0/lib/selenium/webdriver/common/element.rb:151:in `enabled?'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/watir-webdriver-0.6.6/lib/watir-webdriver/elements/element.rb:528:in `assert_enabled'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/watir-webdriver-0.6.6/lib/watir-webdriver/elements/element.rb:119:in `click'
C:/devl/Ruby/features/support/hooks.rb:1177:in `(root)'
org/jruby/RubyBasicObject.java:1565:in `instance_exec'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/core_ext/instance_exec.rb:48:in `cucumber_instance_exec'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/rb_support/rb_hook.rb:14:in `invoke'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:114:in `invoke'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:108:in `execute_after'
org/jruby/RubyArray.java:1693:in `reverse_each'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:107:in `execute_after'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:19:in `after'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime/support_code.rb:112:in `fire_hook'
org/jruby/RubyArray.java:1613:in `each'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime/support_code.rb:111:in `fire_hook'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime.rb:113:in `after'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime.rb:100:in `before_and_after'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime.rb:82:in `with_hooks'
org/jruby/RubyProc.java:271:in `call'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime/support_code.rb:120:in `around'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:9:in `around'
org/jruby/RubyProc.java:271:in `call'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:91:in `execute_around'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/language_support/language_methods.rb:8:in `around'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime/support_code.rb:119:in `around'
org/jruby/RubyProc.java:271:in `call'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime/support_code.rb:117:in `around'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime.rb:94:in `around'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime.rb:81:in `with_hooks'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/outline_table.rb:135:in `accept_expand'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/outline_table.rb:107:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/outline_table.rb:25:in `accept'
org/jruby/RubyArray.java:1613:in `each'
org/jruby/RubyEnumerable.java:978:in `each_with_index'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/outline_table.rb:23:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:90:in `visit_outline_table'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:89:in `visit_outline_table'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/examples.rb:25:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:80:in `visit_examples'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:79:in `visit_examples'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/scenario_outline.rb:19:in `accept'
org/jruby/RubyArray.java:1613:in `each'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/scenario_outline.rb:18:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:74:in `visit_examples_array'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:73:in `visit_examples_array'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/scenario_outline.rb:45:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:58:in `visit_feature_element'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:57:in `visit_feature_element'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/feature.rb:38:in `accept'
org/jruby/RubyArray.java:1613:in `each'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/feature.rb:37:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:27:in `visit_feature'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:26:in `visit_feature'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/features.rb:28:in `accept'
org/jruby/RubyArray.java:1613:in `each'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/features.rb:17:in `each'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/features.rb:27:in `accept'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:21:in `visit_features'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:170:in `broadcast'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/ast/tree_walker.rb:20:in `visit_features'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/runtime.rb:49:in `run!'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/../lib/cucumber/cli/main.rb:47:in `execute!'
C:/jruby-1.7.10/lib/ruby/gems/shared/gems/cucumber-1.3.10/bin/cucumber:13:in `(root)'
org/jruby/RubyKernel.java:1099:in `load'
C:/jruby-1.7.10/bin/cucumber:1:in `(root)'
org/jruby/RubyKernel.java:1099:in `load'
-e:1:in `(root)'

logout and close windows failed

not able to disable survey

SocketError: Permission denied: no further information
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:762:in `connect'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:762:in `connect'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:755:in `do_start'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:744:in `start'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:743:in `start'
C:/jruby-1.7.10/lib/ruby/1.9/net/http.rb:1292:in `request'
./features/page_objects/clean_slate/welcome/clean_ssc_login_page.rb:23:in `visit_login_page'
./features/step_definitions/common/common_login_steps.rb:60:in `login_user_to_site'
./features/step_definitions/awe_clean_slate/footer.rb:9:in `/^I am logged in as an (.*) user$/'
C:\devl\Ruby\features\SSC\general_site\contact_us.feature:6:in `Given I am logged in as an <role> user'

Skipped step

Skipped step

process for failing scenarios failed

Permission denied: no further information

1 个答案:

答案 0 :(得分:3)

基于我的机器上的其他一些软件阻止JRuby运行这些测试,我遇到了这个问题。我发现当我使用JRuby而不是常规Ruby时,McAfee Host Intrusion Prevention似乎放弃了与Selenium的连接。

要检查服务是否正在运行,系统管理员请转到控制面板 - &gt;管理工具 - &gt;服务并查看 McAfee Host Intrusion Prevention 是否列为已启动。

如果是,请在命令提示符窗口中以管理员身份运行 net stop“McAfee Host Intrusion Prevention”。完成后,运行测试并完成测试。