Watir没有按预期工作 - Selenium :: WebDriver :: Error :: UnknownError

时间:2017-07-09 08:29:46

标签: ruby watir watir-webdriver

我安装了Watir并尝试在该网站中提供的一个简单示例。

require 'watir'
browser = Watir::Browser.new :chrome
browser.goto 'https://www.google.com'
browser.text_field(title: 'Search').set 'Hello World!'
browser.button(type: 'submit').click
browser.quit

当我运行Ruby程序时,我收到如下错误。

  

C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib/selenium/web driver / remote / response.rb:69:in& #39; assert_ok':未知错误:Runtime.executionCon textCreated有无效':':{" auxData":{" frameId":" 1352.1"," isDefault":tr ue}," id":1," name":"",&## 34; origin":"://"}(Selenium :: WebDriver :: Error :: UnknownError)(会话信息:chrome = 59.0.3071.115)(驱动程序信息:chromedriver从C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib / selenium / webdriver / remote / response获得= 2.9.248315,platform = Windows NT 6.1 SP1 x86_64 .rb:32:在'初始化'来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/http/common.rb:83:in' new& #39;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/http/common.rb:83:in' create_response& #39;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/http/default.rb:107:in' request && #39;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/http/common.rb:61:in'来电& #39;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/bridge.rb:170:in'执行&#39 ;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/oss/bridge.rb:579:in'执行& #39;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/remote/oss/bridge.rb:52:in' get& #39;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/selenium-webdriver-3.4.3/lib /selenium/webdriver/common/navigation.rb:32:in' to&#39 ;来自C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/watir-6.3.0/lib/watir/browse r.rb:78:in' goto' from example.rb :3:''

我在Windows 7上运行。

1 个答案:

答案 0 :(得分:3)

您正在针对chrome v59运行chromedriver=2.9.248315。升级到chromedriver 2.30,支持chrome v58-60。