Chrome Profile Settings and Capybara 1.1 Stable

We previously blogged about how to test file downloads with capybara and chromedriver that explained how to create a profile that specified where to send downloaded files.

We had take a similar approach with a recent project, except instead of declaring a different download directory we were setting the window placement to alter Chrome’s size. This seems to have broken with a recent version of Chrome.

Instead of relying on settings like this to adjust Chrome’s window size:

profile[''] = 0
profile['browser.window_placement.left'] = 0
profile['browser.window_placement.right'] = 10000
profile['browser.window_placement.bottom'] = 10000

Set the --window-size=width,height command-line switch by including the args hash option:,
  :browser => :chrome,
  :profile => profile,
  :args => ["--window-size=10000,10000"]
Photo of Brian Ryckbost

Brian is vice president and a veteran software developer. He pairs his technical vision with an entrepreneurial mind to drive the company forward. A graduate of Calvin College with a degree in Computer Science, he lives in Holland, MI with his wife and three kids.

He has never seen the classic 1984 comedy Ghostbusters.


Post a Comment

(optional — will be included as a link.)
  1. Do you know how the equivalent commandline switch/arg for profile[“download.default_directory”] is?
    May 04, 2013 at 9:16 AM