Get default folder path using Selenium WebDriver

I am new to selenium, and I would like to know how to get the default path to the browser download folder (I use chrome) in the operating system.

I just found a way to set the default path as follows:

var chromeOptions = new ChromeOptions(); chromeOptions.AddUserProfilePreference("download.default_directory", path); chromeOptions.AddUserProfilePreference("intl.accept_languages", "nl"); chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true"); var driver = new ChromeDriver("Driver_Path", chromeOptions); 
+6
source share
1 answer

2 ways to achieve this.

Here you can find: Find the Chrome path

Type seconds on browswer (you can do this via sendKeys):

 chrome://settings 

then instruct your web admin to click "advanced" and finally you can grab the default download directory from "location"

If youโ€™re stuck anywhere or want more help, let me know. Good luck

0
source

All Articles