Watir with chrome native headless

358 views
Skip to first unread message

juan Barbera

unread,
Sep 12, 2017, 11:32:03 AM9/12/17
to Watir General
Hi all

Currently i m using a ruby -watir framework with docker , i m trying to test the new native headless of chrome without xvfb , but seems that there are still some issues, as example with native headless watir is unable to find some elements that works on chrome with xvfb , has anyone achieve a succesfull test with chrome headless native.

My system :

Ubuntu 16.04
Chrome 61
Chromedriver 2.31

browser = Watir::Browser.new :chrome,
switches: %w[--headless
--disable-gpu --no-sandbox
--disable-prompt-on-repost
--windows-size=3200x1800]

Titus Fortner

unread,
Sep 12, 2017, 12:03:34 PM9/12/17
to Watir General
Watir has a shortcut for headless right now:
Watir::Browser.new :chrome, headless: true

All it is doing is the first of the two switches you mentioned, though.
As for what is currently supported, we run all of our specs with headless turned on (on Linux), and you can see by the guards we've put in place in the _spec files what isn't supported yet:
https://github.com/watir/watir/search?q=headless

Right now it is mostly alerts, multiple window handling and event firing. Most other things should work just fine. It's still a new feature, though, so expect it to improve.

Titus
Reply all
Reply to author
Forward
0 new messages