Tag: selenium firefoxdriver

自动设置WebDriver的configuration文件来打开Excel文件

我find了解决scheme来悄悄下载文件(没有打开/保存对话框),但找不到任何设置WebDriverconfiguration文件自动打开一个文件而不保存。 使用selenium和C#。 该文件是一个.csv,这里是我的代码: FirefoxProfile profile = new FirefoxProfile(); //set to automatically open file profile.SetPreference("browser.helperApps.alwaysAsk.force", false); profile.SetPreference("browser.helperApps.neverAsk.openFile","text/csv,application/vnd.ms-excel,application/excel"); profile.SetPreference("browser.download.manager.showWhenStarting", false); Instance = new FirefoxDriver(profile); 我是否缺less插件?