How to change the browser default download directory

Changing the browser default download location with the RPA.Browser.Playwright and RPA.Browser.Selenium libraries.


Browsers have a default directory where downloaded files are stored. When your automation includes steps where the web browser initiates the download of files (for example clicking on a button), you will probably want to specify your own target directory for downloads. This allows the robot to reach the downloaded files and use them in the next steps of the process.

The following robot downloads a file to a custom browser download directory:

Selenium (RPA.Browser.Selenium)

Before opening the browser using the Open Available Browser keyword, we add the Set Download Directory keyword, passing it the directory where we want the files to be saved. In this case, we want the robot to download to the current directory (${CURDIR}).

Playwright (RPA.Browser.Playwright)