How to access Save buttons in file download confirm dialogs

2 posts, 0 answers
  1. Robert
    Robert avatar
    2 posts
    Member since:
    Nov 2012

    Posted 14 Mar 2014 Link to this post


    I have a few unit tests that I had to introduce pixel based click events to get around not being able to reference the save buttons in the file download control of the browser.

    To be more specific, I am referring to when you are being prompted to download a file and depending on the browser it will have a save button, or save as etc.

    In my unit tests, I first need to download the CSV file before I can read it in and evaluate some data. The only way I could figure out how to do this is by hard-coding a pixel based click event. After reading online, it appears its impossible by legal means to access the protected and non-exposed controls for the file downloading through the browser via client-side functionality.

    Is there any other way to accomplish this?

    This testing framework being used is for the ASP.NET MVC 4.5 web application. 
  2. Boyan Boev
    Boyan Boev avatar
    1072 posts

    Posted 19 Mar 2014 Link to this post

    Hi Robert,

    Please check out this article.

    It describes in details how to handle a download dialog via code.

    Hope this helps.

    Boyan Boev
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top