1

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?

1
  • The simple answer is no, but there are workarounds such as Alexey's answer below, or using different application automation frameworks to handle the prompts.
    – Sam Woods
    Oct 30, 2013 at 15:34

1 Answer 1

2

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);
2
  • Can you give provide more detailed answer Thanks in advance
    – Reya
    Oct 28, 2013 at 21:10
  • I've added some details to my answer Oct 29, 2013 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.