2

我使用步骤来运行此链接上提供的 chrome 脚本,它显示错误我按照以下链接中建议的步骤安装了 chrome 驱动程序,但它不起作用

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

我的电脑配置 Win 7 & 64bit

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"
4

2 回答 2

1

感谢您提供详细信息以检查所有版本。我的版本-> 它向我展示了 watir webdriver 的 3 个版本我卸载了旧版本现在它工作正常现在我的版本是 watir-webdriver (0.6.1)

于 2012-05-29T06:15:22.380 回答
0

如果您还没有这样做,请尝试确保当您打开 cmd 窗口以启动 IRB 或其他 watir 脚本时,您是“以管理员身份”执行此操作的。这有时会对 Vista 和 Win7 产生影响

于 2012-05-28T21:49:10.063 回答