I'm trying to debug why when running remote webdriver tests on a headless linux host download dialogs are presented in chrome. I believe the chrome version is 45.
Couple of Env Details
- Selenium 2.53 (gem)
- Selenium 2.53 Server Jar
- Chrome Driver 2.21
The framework/Tests are written in Ruby utilizing Capybara for driving web tests. Here is a brief snippet of how the remote driver is initialized.
prefernces = {
:download => {
:prompt_for_download => false,
:default_directory => '/home/john.doe/Downloads/'
}
}
caps = Selenium::WebDriver::Remote::Capabilities.chrome()
caps['chromeOptions'] = {'prefs' => prefernces}
http_client = Selenium::WebDriver::Remote::Http::Default.new
http_client.timeout = 240
options = {
browser: :remote,
url: "http://<server_url>:4444/wd/hub",
desired_capabilities: caps,
http_client: http_client
}
# Returns Remote Driver
Capybara::Selenium::Driver.new(app, options)
I have verified via the hub that the chromeOptions are set, but when a file is downloaded, we're presented with a file dialog prompt.
I've burned the candle looking for a solution to this problem. Thanks for the help and consideration!