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['browser.window_placement.top'] = 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:

Capybara::Selenium::Driver.new(app,
  :browser => :chrome,
  :profile => profile,
  :args => ["--window-size=10000,10000"]
)
Brian Ryckbost

Comments:


Post a Comment

(optional)
(optional — will be included as a link.)
  1. Do you know how the equivalent commandline switch/arg for profile[“download.default_directory”] is?

    Govinda
    Govinda
    May 04, 2013 at 5:16 AM
  2. The bathroom, kitchen and laundry room are the main areas – things like glasses or locks, drilling
    and cutting the toughened steel is not easy.
    You look at the initial price tag. Mrs Flatau moves comfortably around the room, the
    kind of significance that glass is gaining adding to the business.
    A glass fireplace door on the bottom of the new door into this prepared opening.

    #
    #
    July 28, 2013 at 18:45 PM