Firefox的Watir Timeout问题

时间:2016-09-22 20:38:25

标签: firefox rubygems watir watir-webdriver rubymine

我试图通过RubyMine运行以下ruby代码:

要求' ruby​​gems' 要求' watir-webdriver' browser = Watir :: Browser.new:firefox browser.goto' http://www.apple.com'

当我跑步时,我收到以下错误:

firefox连接60秒(127.0.0.1:7055)(Selenium :: WebDriver :: Error :: WebDriverError)     来自/Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/firefox/launcher.rb:55:in block in launch' from /Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/common/socket_lock.rb:43:in锁定'     来自/Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/firefox/launcher.rb:51:in launch' from /Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/firefox/bridge.rb:43:in初始化'     来自/Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/common/driver.rb:53:in new' from /Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/common/driver.rb:53:in对于'     来自/Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver.rb:84:in {{1} }初始化'     来自/Users/mark/cheezy/first_script.rb:3:in for' from /Users/mark/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/watir-webdriver-0.9.3/lib/watir-webdriver/browser.rb:46:in'     来自-e:1:new' from /Users/mark/cheezy/first_script.rb:3:in'

我安装了最新的Watir-Webdriver gem。

有什么想法吗?

由于

1 个答案:

答案 0 :(得分:1)

对于Firefox 48+,您需要使用geckodriver。 从这里下载:https://github.com/mozilla/geckodriver/releases

Selenium说明:https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver

Watir说明:http://watir.github.io/watir-6-beta/

如果您有任何其他问题,请与我们联系。