Download file at custom path using Selenium WebDri

2019-02-18 06:06发布

I am new to selenium and i would like to download file with selenium chrome web driver in specific custom folder. In default the file is downloading in browser specified download path. Any one suggest the best solution for downloading file in custom path in C# Selenium.

1条回答
Ridiculous、
2楼-- · 2019-02-18 06:23

Hope it will be help for you!!

var chromeOptions = new ChromeOptions();
 chromeOptions.AddUserProfilePreference("download.default_directory", "Your_Path");
 chromeOptions.AddUserProfilePreference("intl.accept_languages", "nl");
 chromeOptions.AddUserProfilePreference("disable-popup-blocking", "true");
var driver = new ChromeDriver("Driver_Path", chromeOptions);
查看更多
登录 后发表回答