2012-06-04 37 views
0

你好我正在使用Windows 7,我希望使用watir-webdriver和ruby 1.9.2。請告訴我爲什麼我得到這個:當主機文件重定向本地主機時,Watir-WebDriver無法正常工作

C:\>irb 

irb(main):001:0> require "watir-webdriver" 

=> true 

irb(main):002:0> browser = Watir::Browser.new :ff 

Errno::EADDRNOTAVAIL: ??dany adres jest nieprawid?owy w tym kontek?cie. - bind(2 
) 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/socket_lock.rb:45:in `initialize' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/socket_lock.rb:45:in `new' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/socket_lock.rb:45:in `can_lock?' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/socket_lock.rb:31:in `lock' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/socket_lock.rb:17:in `locked' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/launcher.rb:32:in `launch' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/firefox/bridge.rb:19:in `initialize' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/common/driver.rb:31:in `new' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver/common/driver.rb:31:in `for' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.22.0/lib/s 
elenium/webdriver.rb:65:in `for' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.1/lib/watir 
-webdriver/browser.rb:35:in `initialize' 
     from (irb):2:in `new' 
     from (irb):2 
     from C:/Ruby193/bin/irb:12:in `<main>' 
irb(main):003:0> 

非常感謝您的幫助!

回答

0

您很可能有一個主機條目將localhost重定向到其他位置。

刪除該條目,事情應該正常工作。

+0

感謝您的工作正常 – user1033392

+0

如果解決了您的問題,您應該接受答案 –

相關問題