Created
March 19, 2019 01:23
-
-
Save localhostdotdev/3dcec5d0de38ce5842f8e41ff6957b8e to your computer and use it in GitHub Desktop.
Set window size, proxy, no infobars, no notifications, no google sync, no audio, ublock (ad blocker and more), config for selenium/capybara/chromedriver in ruby
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 :selenium_chrome do |app| | |
options = Selenium::WebDriver::Chrome::Options.new | |
options.add_argument("--window-size=1440,900") | |
options.add_argument("--proxy-server=localhost:8080") | |
options.add_argument("--disable-infobars") | |
options.add_argument("--disable-notifications") | |
options.add_argument("--disable-sync") | |
options.add_argument("--mute-audio") | |
options.add_extension( | |
File.expand_path("../tmp/ublock.crx", File.dirname(__FILE__)) | |
) | |
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment