Created
October 13, 2013 01:58
-
-
Save mars/6957187 to your computer and use it in GitHub Desktop.
Set window size for Capybara/Selenium/chromedriver
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
Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, | |
browser: :chrome, | |
desired_capabilities: { | |
"chromeOptions" => { | |
"args" => %w{ window-size=1024,768 } | |
} | |
} | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was not able to get this to work for me with the
HEADLESS=true bundle exec rspec
syntax. I ended up registering two drivers:selenium_chrome
and:selenium_chrome_headless
and using a separateselenium.rb
: