I've figured out how to do this for my Ruby on Rails app, which uses RSpec, Capybara, and Selenium WebDriver. Here's the code I use to set up my Capybara driver and place the dock at the bottom. I also configured the "Console" tab to be selected by default.
options = Selenium::WebDriver::Chrome::Options.new
options.add_preference(
'devtools',
'preferences' => {
'currentDockState' => '"bottom"', # Or '"undocked"'
'panel-selectedTab' => '"console"',
}
)
...
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
options: options,
desired_capabilities: capabilities,
I figured out how to set these preferences by looking at ~/Library/Application Support/Google/Chrome/Default/Preferences
. This is
where my main Google Chrome installation stores my user preferences.
You can view all of the possible settings under devtools
=> preferences
. Note that all the values are strings that are parsed as JSON, so you need to "double-wrap" any strings in your code: '"bottom"'
.