`
温柔一刀
  • 浏览: 862365 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Exception: Bad file descriptor - connect(2)

阅读更多
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.
分享到:
评论
2 楼 温柔一刀 2007-08-07  
3Q,I forget to run the selenium-server.
1 楼 gigix 2007-08-07  
Is your web application running?

相关推荐

Global site tag (gtag.js) - Google Analytics