I am new to Selenium WebDriver.

I need to download the file, if we click on download, after downloading it it will ask confirmation to open or save file. It should save without asking confirmation.

Please help me how to handle this.

  • 1
    When you say "it should save without asking confirmation" do you mean you need to know how to handle the confirmation dialog (which is standard in web applications) or you need to know how to disable the confirmation dialog for testing purposes?
    – Kate Paulk
    Jan 7 '14 at 13:11

If your goal is to bypass the confirmation for testing purposes, I know this can be done for Chrome:

  1. Open chrome://settings/ in the Chrome browser
  2. Select the "Show advanced settings..." link
  3. Scroll down to the "Downloads" settings
  4. Uncheck the box labeled "Ask where to save each file before downloading"

If you run your tests on Chrome you should be able to verify your download process with a more pure Selenium approach (not having to dabble in any black magic to get script away that dialog)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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