How to save compiled document on Desktop using C# Selenium



  • Using Selenium WebDriver with C# in VS 2010, I compiled a document using automation and then I want to save the file on my desktop. During automation a new window is popping up to "save or open file". Is there any code available in C# Selenium to manipulate this dialog popup?



  • Use profile setting for browsers:

    firefoxProfile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
    

    Browser initialize

    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("browser.helperApps.neverAsk.saveToDisk","text/csv");
    IWebDriver webDriver = new FirefoxDriver(profile);
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2