Last active
October 18, 2018 18:26
-
-
Save fernyb/cdcf1f5e27a8d89a994c17213cffe9be to your computer and use it in GitHub Desktop.
ruby selenium webdriver chrome capabilities options headless
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
caps = Selenium::WebDriver::Remote::Capabilities.chrome | |
caps['acceptInsecureCerts'] = true | |
caps['acceptSslCerts'] = true | |
caps['loggingPrefs'] = { 'performance' => 'ALL' } | |
caps['chromeOptions'] = { | |
'perfLoggingPrefs' => { 'enableNetwork' => true }, | |
:args => [ | |
"--disable-web-security", | |
"--allow-running-insecure-content", | |
"--ignore-certificate-errors", | |
"--allow-insecure-localhost", | |
"--no-sandbox", | |
"--disable-popup-blocking", | |
"--disable-translate", | |
"--window-size=1400,1920", | |
"--disable-extensions-file-access-check", | |
"--disable-extensions", | |
"--disable-impl-side-painting" | |
"--headless", | |
"--disable-gpu" | |
] | |
} | |
Capybara.register_driver :selenium do |app| | |
Capybara::Selenium::Driver.new(app, | |
:url => "http://localhost:4444/wd/hub", | |
:browser => :remote, | |
:desired_capabilities => caps | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment