c# – 使用Selenium WebDriver在自定义路径下载文件

我是selenium的新手,我想在特定的自定义文件夹中下载带有selenium chrome web驱动程序的文件.默认情况下,文件在浏览器指定的下载路径中下载.任何人都建议在C#Selenium中自定义路径下载文件的最佳解决方案.

解决方法:

希望对您有所帮助!!

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);

相关文章

转载地址:https://www.cnblogs.com/mini-monkey/p/12104821...
web自动化测试过程中页面截图相对比较简单,可以直接使用sel...
目录前言一、Selenium简介二、浏览器驱动1.浏览器驱动参考2....
一、iframe的含义:iframe是HTML中框架的一种形式,在对界面...
转载请注明出处❤️作者:测试蔡坨坨原文链接:caituotuo.to...
'''##**认识selenium**​**下载:pipinstall...