论坛首页 编程语言技术论坛

Exception: Bad file descriptor - connect(2)

浏览 4938 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2007-08-07  
Hi,all

I am trying to test web application using the sample code:

ruby 代码
 
  1. require "selenium"  
  2. require "test/unit"  
  3.   
  4. class NewTest < Test::Unit::TestCase  
  5.   def setup  
  6.     @verification_errors = []  
  7.     if $selenium  
  8.       @selenium = $selenium  
  9.     else  
  10.       @selenium = Selenium::SeleneseInterpreter.new("localhost", 4444, "*firefox""http://localhost:4444", 10000);  
  11.       @selenium.start  
  12.     end  
  13.     @selenium.set_context("test_new""info")  
  14.   end  
  15.    
  16.   def teardown  
  17.     @selenium.stop unless $selenium  
  18.     assert_equal [], @verification_errors  
  19.   end  
  20.    
  21.   def test_new  
  22.     @selenium.open "/cn/articles/domain-web-testing"  
  23.     @selenium.click "//a[contains(@href, '/cn/')]"  
  24.     @selenium.wait_for_page_to_load "30000"  
  25.   end  
  26. end  


When executing, I got the following error message:

 
  1. Exception: Bad file descriptor - connect(2)  
  2. D:/ruby/lib/ruby/1.8/net/http.rb:560:in `initialize'  
  3. D:/ruby/lib/ruby/1.8/net/http.rb:560:in `open'  
  4. D:/ruby/lib/ruby/1.8/net/http.rb:560:in `connect'  
  5. D:/ruby/lib/ruby/1.8/timeout.rb:48:in `timeout'  
  6. D:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'  
  7. D:/ruby/lib/ruby/1.8/net/http.rb:560:in `connect'  
  8. D:/ruby/lib/ruby/1.8/net/http.rb:553:in `do_start'  
  9. D:/ruby/lib/ruby/1.8/net/http.rb:542:in `start'  
  10. D:/ruby/lib/ruby/1.8/net/http.rb:1032:in `request'  
  11. D:/ruby/lib/ruby/1.8/net/http.rb:769:in `get'  
  12. E:\ruby\workspace\dcrm2/test\selenium/selenium.rb:159:in `do_command'  
  13. D:/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'  
  14. D:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'  
  15. E:\ruby\workspace\dcrm2/test\selenium/selenium.rb:148:in `do_command'  
  16. E:\ruby\workspace\dcrm2/test\selenium/selenium.rb:143:in `stop'  
  17. E:\ruby\workspace\dcrm2/test/selenium/new_test.rb:17:in `teardown'  
  18. D:/ruby/lib/ruby/1.8/test/unit/testcase.rb:79:in `run'  
  19. D:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'  
  20. D:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'  
  21. D:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'  
  22. D:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'  
  23. D:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'  
  24. D:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'  
  25. D:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in `run_suite'  
  26. D:/Program Files/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:107:in `start_mediator'  
  27. D:/Program Files/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:52:in `start'  
  28. D:/Program Files/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:272  


Any idea? Thanks beforehand for your help.

I am running  ruby 1.8.5 (i386-mswin32) on Windows XP.
   发表时间:2007-08-07  
Is your web application running?
0 请登录后投票
   发表时间:2007-08-07  
3Q,I forget to run the selenium-server.
0 请登录后投票
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics