2015-06-29 59 views
0

我的設置:Windows 7中,紅寶石1.9.3
我已經試過這四個人電腦(Windows 7)中,只有一個是正常
我曾嘗試紅寶石2.1.6,它也出現
我試過了watir-driver的0.7.0版本,沒用!使用的Watir :: Browse.new打開Firefox的出現分段錯誤

*當地的寶石*

bigdecimal (1.1.0) 
childprocess (0.5.6) 
ffi (1.9.9 x86-mingw32) 
io-console (0.3) 
json (1.5.5) 
minitest (2.5.1) 
multi_json (1.11.1) 
rake (0.9.2.2) 
rdoc (3.9.5) 
rubyzip (1.1.7) 
selenium-webdriver (2.46.2) 
watir-webdriver (0.8.0) 
websocket (1.2.2) 

代碼:

1 require 'watir-webdriver' 
2 browser = Watir::Browser.new 
3 browser.go_to "https://www.baidu.com" 
4 browser.close 

錯誤信息:有錯誤信息

C:\Ruby193\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) E:/Automation/Automation/watir_test/web_test1.rb 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311: [BUG] Segmentation fault 
    ruby 1.9.3p551 (2014-11-13) [i386-mingw32] 

    -- Control frame information ----------------------------------------------- 
    c:0022 p:---- s:0087 b:0087 l:000086 d:000086 CFUNC :get_osfhandle 
    c:0021 p:0122 s:0083 b:0083 l:000082 d:000082 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311 
    c:0020 p:0066 s:0077 b:0076 l:000075 d:000075 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:270 
    c:0019 p:0213 s:0072 b:0072 l:000071 d:000071 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess.rb:153 
    c:0018 p:0054 s:0067 b:0067 l:000066 d:000066 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:64 
    c:0017 p:0051 s:0063 b:0063 l:000062 d:000062 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:49 
    c:0016 p:0011 s:0059 b:0059 l:000058 d:000058 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:35 
    c:0015 p:0017 s:0055 b:0055 l:001c9c d:001c9c METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/launcher.rb:51 
    c:0014 p:0175 s:0052 b:0052 l:000051 d:000051 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/bridge.rb:41 
    c:0013 p:---- s:0042 b:0042 l:000041 d:000041 FINISH 
    c:0012 p:---- s:0040 b:0040 l:000039 d:000039 CFUNC :new 
    c:0011 p:0200 s:0036 b:0036 l:000035 d:000035 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/driver.rb:50 
    c:0010 p:0021 s:0029 b:0029 l:000028 d:000028 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver.rb:84 
    c:0009 p:0129 s:0025 b:0025 l:000024 d:000024 METHOD C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:45 
    c:0008 p:---- s:0020 b:0020 l:000019 d:000019 FINISH 
    c:0007 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC :new 
    c:0006 p:0029 s:0015 b:0015 l:000014 d:000014 TOP E:/Automation/Automation/watir_test/web_test1.rb:4 
    c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH 
    c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :load 
    c:0003 p:0051 s:0006 b:0006 l:000abc d:001d64 EVAL -e:1 
    c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH 
    c:0001 p:0000 s:0002 b:0002 l:000abc d:000abc TOP 

    -- Ruby level backtrace information ---------------------------------------- 
    -e:1:in `<main>' 
    -e:1:in `load' 
    E:/Automation/Automation/watir_test/web_test1.rb:4:in `<top (required)>' 
    E:/Automation/Automation/watir_test/web_test1.rb:4:in `new' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:45:in `initialize' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver.rb:84:in `for' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/driver.rb:50:in `for' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/driver.rb:50:in `new' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/bridge.rb:41:in `initialize' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/firefox/launcher.rb:51:in `launch' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:35:in `locked' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:49:in `lock' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.46.2/lib/selenium/webdriver/common/socket_lock.rb:64:in `can_lock?' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess.rb:153:in `close_on_exec' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:270:in `dont_inherit' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311:in `handle_for' 
    C:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:311:in `get_osfhandle' 

    -- C level backtrace information ------------------------------------------- 
. 
. 
. 
. 
[NOTE] 
You may have encountered a bug in the Ruby interpreter or extension libraries. 
Bug reports are welcome. 
For details: http://www.ruby-lang.org/bugreport.html 


This application has requested the Runtime to terminate it in an unusual way. 
Please contact the application's support team for more information. 
+0

'go_to'不是一個有效的Watir :: WebDriver方法。你會想用'goto'代替。這似乎不太可能會導致段錯誤,但在修復它之後嘗試重新運行。 – Johnson

回答

1

我相信我能成爲的一部分幫助。我遇到了這個確切的問題。問題在於最新版本的ffi gem。我能夠強制ffi的版本是1.9.8。這糾正了我的問題。有關ffi的問題已有報道。你可以沿着這裏:https://github.com/ffi/ffi/issues/440