how i download a file from any website through selenium

  • 2 Answer(s)

    Hi,

    Please explain the Question more practically., because to download a file from site may depend on browser.

    Firefox : gives a pop and then allow to download file.
    chrome: it can directly download the file on clicking of click,

    So, please explain the question in a proper way.

    Train Answered on June 17, 2016.

    I am using Firefox. how I control the profile and pop of a firefox for download any file

    on June 17, 2016.
    Add Comment

    Well since you are using Firefox. The download dialog cannot be controled by JavaScript. So this is a ‘no can do’ in selenium. It will just stay open.

    But you are lucky, there is a workaround for this. You can set your browsers download location to a specific place and then check if the file arrived.

    This would make you able to confirm the file is downloaded.

     

    Some posts that might be helpful for you:

    – http://kb.mozillazine.org/File_types_and_download_actions
    – https://blog.codecentric.de/en/2010/07/file-downloads-with-selenium-mission-impossible/

    Default Answered on July 6, 2016.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.