2012-05-28 45 views
2

我使用步驟來運行設置在該鉻腳本鏈接其示值誤差 我安裝了Chrome驅動程序步驟,建議在下面的鏈接,但它不工作腳本在Chrome中運行顯示錯誤

https://github.com/zeljkofilipin/watirbook/blob/master/installation/windows.md#chrome-with-watir-webdriver 

我的電腦配置的Win 7 & 64位

C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.9-x86-mingw32/lib/ffi/platform.rb:27 
: Use RbConfig instead of obsolete and deprecated Config. 
Started ChromeDriver 
port=54035 
version=20.0.1133.0 
log=D:\chromedriver.log 
=> #<Watir::Browser:0x3568d490 url="chrome://newtab/" title="New Tab"> 
irb(main):003:0> browser.goto "watir.com" 
[0528/164700:ERROR:automation_proxy.cc(367)] Channel error in AutomationProxy. 
Selenium::WebDriver::Error::UnknownError: Chrome did not respond to 'WaitForAllT 
absToStopLoading'. Elapsed time was 1 ms. 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/response.rb:52:in `assert_ok' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/response.rb:15:in `initialize' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/http/common.rb:59:in `new' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/http/common.rb:59:in `create_response' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/http/default.rb:64:in `request' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/http/common.rb:40:in `call' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/bridge.rb:598:in `raw_execute' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/bridge.rb:576:in `execute' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/remote/bridge.rb:155:in `getCurrentUrl' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.21.2/lib/s 
elenium/webdriver/common/driver.rb:118:in `current_url' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.5.8/lib/watir 
-webdriver/browser.rb:78:in `url' 
     from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.5.8/lib/watir 
-webdriver/browser.rb:66:in `goto' 
     from (irb):3 
     from C:/Ruby193/bin/irb:12:in `<main>' 
irb(main):004:0> 

我使用的代碼作爲

>irb 

    > require "watir-webdriver" 
    => true 

    > browser = Watir::Browser.new :chrome 
    Started ChromeDriver 
    port=49522 
    => #<Watir::Browser:0x..fd 

bf27548 url="about:blank" 
title="about:blank"> 

> browser.goto "watir.com" 
+0

您正在使用什麼版本的Watir-的webdriver的? (「寶石列表」命令會告訴你所有的寶石的版本,包括的Watir-webdriver的 –

+0

感謝您提供詳細內容,檢查所有版本。我的版本 - >的Watir-的webdriver(0.6.1) –

回答

0

如果您還沒有這樣做,請嘗試確保當您打開一個cmd窗口來啓動IRB或其他watir腳本時,您以管理員身份執行此操作。有時,這可以與Vista和Win7

+0

是所有腳本在管理員模式下運行cmd提示 –

1

感謝差異用於提供詳細內容,檢查所有版本。我的版本 - >它顯示了我3個版本的Watir webdriver的的我 卸載舊版本,現在它工作正常 現在我的版本,它的Watir-的webdriver(0.6.1)

+0

有趣的是,理論上這不應該導致問題,但很高興知道清除舊版本可以解決您的問題。 –