Skip to content

Instantly share code, notes, and snippets.

@Blackbaud-TitusFortner
Created July 11, 2014 18:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Blackbaud-TitusFortner/c5503da9043b13969f59 to your computer and use it in GitHub Desktop.
Save Blackbaud-TitusFortner/c5503da9043b13969f59 to your computer and use it in GitHub Desktop.
Headless support in watirmark
def new_watir_browser
set_headless if config.headless
.....
end
def set_headless
begin
require 'headless'
@headless = Headless.new
@headless.start
rescue LoadError, Headless::Exception => e
unless RbConfig::CONFIG['host_os'].match('linux')
warn "Attempted to run in headless mode, but xvfb support is limited to linux"
else
warn "Attempted to run in headless mode, but #{e.message}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment