Capybara.register_driver :chrome do |app| | |
Capybara::Selenium::Driver.new(app, | |
browser: :chrome, | |
desired_capabilities: { | |
"chromeOptions" => { | |
"args" => %w{ window-size=1024,768 } | |
} | |
} | |
) | |
end |
This comment has been minimized.
This comment has been minimized.
KacperPucek
commented
Feb 7, 2017
Worked like a charm, thanks :) |
This comment has been minimized.
This comment has been minimized.
mariusandra
commented
Feb 24, 2017
•
This didn't work for me, but this did: Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(app,
browser: :chrome,
args: ["--window-size=1024,768"]
)
end |
This comment has been minimized.
This comment has been minimized.
harokevin
commented
Aug 25, 2017
worked for me |
This comment has been minimized.
This comment has been minimized.
rounders
commented
Oct 5, 2017
with selenium-webdriver 3.6.0 the following did the trick for me: Capybara.register_driver :chrome do |app|
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument("--window-size=1024,768")
Capybara::Selenium::Driver.new(app,
browser: :chrome,
options: options
)
end |
This comment has been minimized.
This comment has been minimized.
paneq
commented
Mar 2, 2018
Thank you @rounders :) |
This comment has been minimized.
This comment has been minimized.
seanlinsley
commented
May 10, 2018
@rounders' solution worked for me as well |
This comment has been minimized.
This comment has been minimized.
gayathri-sapaad
commented
Jan 8, 2019
This worked for me Thanks @mars |
This comment has been minimized.
This comment has been minimized.
vivipoit
commented
Jan 16, 2019
I wanted headless and this is what I did: Capybara.register_driver :selenium_chrome_headless do |app|
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: { args: %w(headless disable-gpu window-size=2500,2500) }
)
Capybara::Selenium::Driver.new app, browser: :chrome, desired_capabilities: capabilities
end
Capybara.javascript_driver = :selenium_chrome_headless I wanted to drop it here, since all of these entries helped me understand what I might need to get to my setup. |
This comment has been minimized.
This comment has been minimized.
khalilgharbaoui
commented
Sep 8, 2019
This works best in 2019:
This is basically the code from the gem itself with some tweaks added: The additional option/flags work for me but you probebly want to checkout what you would need here first: Cheers KG |
This comment has been minimized.
benlieb commentedOct 17, 2016
I had to do:
Capybara.register_driver :selenium do |app|
For this to work