In the watir documentation (http://watir.com/guides/chrome/), it has been mentioned that doing
Watir::Browser.new :chrome, headless: true
will enable us to use headless chrome
This does not seem to work.
I get an error as below
2.4.0 :001 > require 'watir'
=> true
2.4.0 :002 > Watir::Browser.new :chrome, headless: true
ArgumentError: unknown option: {:headless=>true}
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/bridge.rb:86:in `initialize'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/bridge.rb:53:in `new'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/remote/bridge.rb:53:in `handshake'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/chrome/driver.rb:57:in `initialize'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/common/driver.rb:46:in `new'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver/common/driver.rb:46:in `for'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/selenium-webdriver-3.5.1/lib/selenium/webdriver.rb:86:in `for'
from /Users/sandeep.kumar/.rvm/gems/ruby-2.4.0/gems/watir-6.3.0/lib/watir/browser.rb:46:in `initialize'
from (irb):2:in `new'
from (irb):2
from /Users/sandeep.kumar/.rvm/rubies/ruby-2.4.0/bin/irb:11:in `<main>'
The version of chrome I have is 59.0.3071.115
chrome driver version i have is
ChromeDriver 2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b
Using
selenium-webdriver 3.4.3
watir 6.7.1 (was 6.3.0)
watir 6.6
. And FWIW, that's a pretty old version ofchromedriver
that you're running. – Sp