I use an interesting workaround for this. In my suite setup:
Set Global Variable ${global_downloadDir} ${CURDIR}\\Downloads\\${suiteName}
${prefs} = Create Dictionary download.default_directory=${global_downloadDir}
Call Method ${chromeOptions} add_experimental_option prefs ${prefs}
Create Webdriver Chrome chrome_options=${chromeOptions}
In my test teardown I need to empty mi download directory:
Run Keyword And Ignore Error Empty Directory ${global_downloadDir}
Then I have set of two keywords:
Download Should Be Done
[Arguments] ${directory}=${global_downloadDir}
[Documentation] Verifies that the directory has only one folder and it is not a temp file and returns path to the file
${files} = List Files In Directory ${directory}
Length Should Be ${files} 1
Should Not Match Regexp ${files[0]} (?i).*\\.tmp
Should Not Match Regexp ${files[0]} (?i).*\\.crdownload
${file} Join Path ${directory} ${files[0]}
Log File was successfully downloaded to ${file}
[Return] ${file}
Wait Until File Download is Finished
[Arguments] ${directory}=${global_downloadDir} ${timeout}=${global_timeout} ${retry}=2s
${fileName} = Wait Until Keyword Succeeds ${timeout} ${retry} Download should be done ${directory}
[Return] ${fileName}
So now, using the Wait Until File Download is Finished keyword should return your filename:
Click Button id=downloadFile
${filename} = Wait Until File Download is Finished
${content} = Get File ${fileName}