我尝试使用该配置文件的设置下载文件在Firefox,但它不工作,你能告诉我什么,我做错了,我使用的代码被发布这条线为什么我无法使用Selenium Webdriver通过Firefox下载文件?
var profile = new FirefoxProfile { EnableNativeEvents = true };
profile.SetPreference("browser.download.folderList", 2);
profile.SetPreference("browser.download.manager.showWhenStarting", false);
profile.SetPreference("browser.download.dir", folderName);
profile.SetPreference("browser.download.downloadDir", folderName);
profile.SetPreference("browser.download.defaultFolder", folderName);
profile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "image/jpeg,application/vnd.oasis.opendocument.text,application/vnd.oasis.opendocument.spreadsheet," +
"application/vnd.oasis.opendocument.presentation,application/vnd.oasis.opendocument.graphics," +
"application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet," +
"application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation," +
"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.mozilla.xul+xml," +
"application/vnd.google-earth.kml+xml");
那么它不起作用? – Arran 2013-02-18 15:51:42
它不会自动下载文件,我仍然在获取文件下载窗口 – 2013-02-18 15:53:28
作为临时的解决方法,我可以使用AutoIT脚本。 – Hemanth 2013-02-19 06:16:26