2013-11-09 2 views
3

나는 watir-webdriver/MiniTest 프레임 워크를 한 달 만에 사용하고 있으며 실제로 잘 진행되고 있습니다. 그러나 새 빌드가 시작될 때마다 실행해야하는 팩에는 100 개 미만의 개별 테스트가 포함되어 있습니다.Watir-Webdriver - 프로토콜 - 소켓 (2)에 의해 지원되지 않는 주소 패밀리

이것이 CentOS-6-x86_64에서 Ruby, RVM, Watir, Rails 및 Firefox로 VPS를 설치 한 이유입니다. 이렇게하면 내 랩톱에서 스크립트를 실행하고 다른 작업을 수행하기 전에 스크립트가 끝날 때까지 기다릴 필요가 없습니다. 내가 그 Watir과는 IRB를 사용하여 작업 한 테스트하려고하지만

나는 다음과 같은 오류 얻을 :

Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2) 

시험 : 그 오류를 연구하고있다

[[email protected] ~]# irb 
1.9.3p448 :001 > require 'watir-webdriver' 
=> true 
1.9.3p448 :002 > b = Watir::Browser.start 'www.google.com' 
Errno::EAFNOSUPPORT: Address family not supported by protocol - socket(2) 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/port_prober.rb:28:in `initialize' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/port_prober.rb:28:in `new' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/port_prober.rb:28:in `block in free?' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/port_prober.rb:26:in `each' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/port_prober.rb:26:in `free?' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/port_prober.rb:5:in `above' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/firefox/launcher.rb:49:in `find_free_port' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/firefox/launcher.rb:33:in `block in launch' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/ lib/selenium/webdriver/firefox/launcher.rb:32:in `launch' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/firefox/bridge.rb:24:in `initialize' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/driver.rb:31:in `new' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver/common/driver.rb:31:in `for' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/selenium-webdriver-2.37.0/  lib/selenium/webdriver.rb:67:in `for' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/watir-webdriver-0.6.4/lib/ watir-  webdriver/browser.rb:46:in `initialize' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/watir-webdriver-0.6.4/lib/ watir- webdriver/browser.rb:29:in `new' 
     from /usr/local/rvm/gems/ruby-1.9.3-p448/gems/watir-webdriver-0.6.4/lib/ watir-  webdriver/browser.rb:29:in `start' 
     from (irb):2 
     from /usr/local/rvm/rubies/ruby-1.9.3-p448/bin/irb:13:in `<main>'1.9.3p4  1.9.3p448 :003 > 

내가 찾은 많은 사이트를 그 주장은 그것이 내가했던 ipv6을 사용하지 않음으로써 고쳐졌으며 아직도이 오류가 발생하고 있다고 주장한다. 루비 파일이

require "watir-webdriver" 
require 'watir-webdriver' 
require 'headless' 
headless = Headless.new 
headless.start 

browser = Watir::Browser.new :ff 
browser.goto "http://remove-url-for-this-post.com" 
puts ("Starting SearchValSelectFields") 
browser.select_list(:id, "edit-select-sector").select("Finance and Accounting") 
sleep (5) 
browser.select_list(:id, "edit-select-subsector--3").select("All Sub-sector") 
browser.select_list(:id, "edit-select-location").select("Singapore") 
browser.button(:value,"Search").click 
assert(browser.text.include?("Salary and employment forecast")) 
browser.screenshots ('..\screenshots\SearchValSelectFields.png') 
browser.select_list(:id, "edit-select-sector").select("Select Sector") 
sleep(3) 
browser.select_list(:id, "edit-select-subsector--2").select("Select Sub-sector") 
sleep(3) 
browser.select_list(:id, "edit-select-location").select("Select Location") 
sleep(3) 
browser.button(:value,"Search").click 
assert(browser.text.include?("This field is required")) 
browser.close 
headless.destroy 

모든 아이디어를 아래에 게시 -이 차이가 있지만 나는 또한이

편집을 VPS에 Nginx에/PHP는/MySQL이 설치되어있는 경우

확실하지?

+0

을 원한다면 그래서 당신은 당신의 VPS에 파이어 폭스를 실행 wan't를 당신의/etc/hosts 파일을 편집하고 :: 1을 주석 처리하거나 제거입니다 ? 머리가없는 채로 달리기로되어 있나? – phoet

+0

나는 VPS에 firefox를 설치하기위한 가이드를 따랐다. Chrome과 IE를 실제로 실행하고 싶습니다. 그리고 네, 이것은 머리가 아닐 것입니다. – CustomNet

답변

7

직장에서 누군가가 문제를 해결할 수있었습니다. 그는 말했다 :

They try to connect twice 
first to 127.0.0.1 port 7055 
then too ::1 port 7055 
second one fails 
::1 is localhost of IPv6 
so you seem to be connecting localhost 
and in your server look at /etc/hosts 
localhost resolves to the ::1 

을 그래서 당신이해야 할 모든 당신이