我正在使用Selenium运行自动回归测试,并遇到了一些问题。以前我的ChromeDriver会点击将文件下载到我的ChromeOptions中提供的默认目录的链接,但现在它在浏览器中显示一个SaveAs对话框,而不是仅仅自动下载该文件。
有没有办法禁用SaveAs对话框,只是将文件自动下载到我的默认目录?
我的ChromeDriver设置下方..
var driverOptions = new ChromeOptions();
driverOptions.AddUserProfilePreference("download.default_directory", BaseCommon._chromeDefaultDownloadsFolder);
driverOptions.AddUserProfilePreference("intl.accept_languages", "nl");
driverOptions.AddUserProfilePreference("profile.default_content_settings.popups", "0");
driverOptions.AddUserProfilePreference("disable-popup-blocking", "true");
var driverPath = System.IO.Directory.GetCurrentDirectory();
Instance = new ChromeDriver(driverPath, driverOptions);