Set default download directory not working

Hi Robocorp team

I’m running this bot (built in Python) and instantiating a Selenium browser for a specific task. I then als set the default download directory using the set_download_directory method. But when downloading a file it does not download to the directory specified…

from RPA.Browser.Selenium import Selenium

browser: Selenium = Selenium()

browser.set_download_directory(path_to_temp, True)
browser.open_available_browser(url, headless=True)
...

Python version: 3.9.16 , rpaframework version: 22.2.2

Hi and thank you for reporting this!

According to Set Download Directory docs:

If the downloading doesn’t work (file is not found on disk), try using the browser in non-headless (headful) mode when opening it. (headless=${False})

This is backed by our RF robot test: Download PDF in custom directory

1 Like

Thank you @cmin764 , I’ll give that a go. I’m just concerned that this might influence the working of the bot on the cloud runner…

Yes, fortunately, there are alternatives!

You’d need to install Robocorp Workforce Agent on a machine capable of rendering UI and then select that one as the Worker for your Process in CR. (see Workers)

We’ll do our best to overcome this limitation right in this Issue. (no ETA atm)