Downloading files using selenium webdriver and C#

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Downloading files using selenium webdriver and C#

DhanyaReddy
Hi

If anyone has any idea on how to download files /save as  using selenium Webdriver and c#, i tried below code  but not working for me ..
 

FirefoxProfile firefoxProfile = new FirefoxProfile();
            firefoxProfile.SetPreference("browser.download.folderList", 2);
            //firefoxProfile.SetPreference("browser.download.manager.showWhenStarting");
            firefoxProfile.SetPreference("browser.download.dir", @"C:\Users\Desktop\Results");
            firefoxProfile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv");
            //Driver.FindElement = new FirefoxDriver(firefoxProfile);

Thanks