File download window

17 posts, 0 answers
  1. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 23 Mar 2012 Link to this post

    Hi All,

    I have a web page in which I am clicking on a file after which another web page opens with File Download window(1.PNG). After clicking on Save button from 1.PNG another window pops up saying Save As location(2.PNG).When I specify location and click on Save button then third window pops up for Download Complete(3.PNG).
    I want to handle all these 3 windows through VS plug-in in my test case.Right now I am using IE8+W2K3 32.But I have to make it compatible for IE7,IE9 & FireFox for different OSes.
    Please guide me.

    Thanks inadvance
  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 23 Mar 2012 Link to this post

    Hello,

    Have you tried inserting a standard Download Dialog Handler step? This is our recommended, non-coded approach.

    Regards,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 23 Mar 2012 Link to this post

    Hi Anthony,

    I have seen Dialog Handler link but it has not shown anything related with 1.PNG & 2.PNG. I will try and let you know the status.


    Ninja
  4. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 23 Mar 2012 Link to this post

    Hello,

    The Download Dialog Handler is intended to handle all three dialogs sequentially. The Dialogs article only shows the third dialog as a reference.

    Regards,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  5. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 24 Mar 2012 Link to this post

    Hi Anthony,

    Download Dialog handler is not handling 1.PNG & 3.PNG
  6. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 26 Mar 2012 Link to this post

    Hello,

    Since you're using IE8, I suspect dialogs one and two are properly handled, it's just dialog three that remains open after the test completes. Due to a known regression, the third dialog is not currently being handled in IE8. We expect this fix to be included in our next major release, due out in April.

    Regards,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  7. Ninja
    Ninja avatar
    10 posts
    Member since:
    Aug 2011

    Posted 03 Apr 2012 Link to this post

    Anthony,

    With IE8 sometimes dialogs one and two are also not getting handled, some times it is handling some times not.
  8. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 03 Apr 2012 Link to this post

    Hello,

    To troubleshoot further I'll need to see the issue first-hand. Please provide a test that demonstrates the behavior against a public site.
     

    Greetings,
    Anthony
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  9. John
    John avatar
    13 posts
    Member since:
    Apr 2012

    Posted 10 Apr 2012 Link to this post

    Anthony,

    After handling download dialog through Dialog Handler does Test Studio also checks whether the file is actually downloaded to physical location?
  10. N1t1nA
    N1t1nA avatar
    37 posts
    Member since:
    Mar 2011

    Posted 10 Apr 2012 Link to this post

    Hi John 

    I don't think that Test Studio Checks the File after Download,

    you can write the Method like that 

    //Method to Verify File Exists
            public void FileExistsVerification(string fileName)
            {
                //Verify that Filename Exists in System             
                try
                {
                    //Check if the File Exists
                    if ((File.Exists(fileName) == true))
                    {
                        //Write the log if File Exists
                        Manager.Current.Log.WriteLine(" File Exists: " + " " + fileName );
                    }
                    else
                    {
                        //Throws the Exception if File does not Exists
                        throw new FileNotFoundException(" File does not Exists: ", fileName );
                    }
                }


                finally
                {
                            System.Threading.Thread.Sleep(2000);       
                }
            }





  11. Byron
    Admin
    Byron avatar
    184 posts

    Posted 10 Apr 2012 Link to this post

    Hi John,

    Thanks for helping us understand the precise behavior you want to test. Nitin is correct: Test Studio does not test for the existence of the downloaded file on the local file system. Test Studio focuses on the browser, and assumes that the download was successful if the browser generates a successful download message.

    Please let us know if you have any further questions.

    @Nitin. Thanks for assisting. I've updated your Telerik Points as a way of saying thank you.

    Regards,
    Byron Landry
    The Telerik Team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  12. John
    John avatar
    13 posts
    Member since:
    Apr 2012

    Posted 22 Apr 2012 Link to this post

    @Nitin,Byron - when file does not exists at specified location(FileNotFoundException()) how can I explicitly Fail the test case here so that rest os the test case execution should skip?
  13. Byron
    Admin
    Byron avatar
    184 posts

    Posted 23 Apr 2012 Link to this post

    Hello John,

    Any unhandled exception within the coded step will fail the test step (and test) immediately. In this case, the FileNotFoundException will result in failure, and the rest of the code in that coded step will not be executed. 

    Using Quick Execution, a test will stop when one of its steps fails unless the step is marked as Continue on Failure. When using a test list, the default behavior is that the entire test containing the coded step will fail, but the rest of the test list will continue to run. 

    Kind regards,
    Byron
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  14. John
    John avatar
    13 posts
    Member since:
    Apr 2012

    Posted 26 Apr 2012 Link to this post

    Thanx Byron for the info.
    Explicitly how to Pass the test case from Coded step/Test Studio steps?
    Means by throwing unhandled exception we can Fail the test case, in the same way how to Pass the test case?
  15. Byron
    Admin
    Byron avatar
    184 posts

    Posted 26 Apr 2012 Link to this post

    Hello John,

    Any coded step that executes without an unhandled exception will pass. It is not necessary to pass a test step explicitly. If you want to ensure that your test continues despite a failed step (whether coded or not), you can mark a step as continue on failure. If you would like your step to pass despite an exception, you can wrap the relevant code in a try-catch statement to handle the exception. 

    All the best,
    Byron
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  16. Rupesh
    Rupesh avatar
    2 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2012 Link to this post

    Hi Byron,

    I have upgraded my environment to 2012.1.528 to resolve download dialog issue but still I am facing issues with IE 7,8 & 9.
    For IE 9 with Win 7 it fails to handle IE9.png dialog.
    For IE 8 on W2K3 it fails to handle 3.PNG from original thread.
    For IE 7 it fails to handle 1.PNG from original thread but says Handle Download dialog step is Passed.

    Do you have issues with handle download dialog in this build?
  17. Byron
    Admin
    Byron avatar
    184 posts

    Posted 15 Jun 2012 Link to this post

    Hi Rupesh,

    This issue should be partially resolved: the only known issue that remains is only in Windows XP. If possible, please provide a copy of your test and access to your application. If this is not possible, please provide access to a similar test against a public application that demonstrate the same behavior. Also, please provide the failure log for your issue. You can export these to file from the failure tab for your test. A Jing video demonstrating the issue may also help us to better understand what is happening. Thanks for providing the information we need to assist you.

    All the best,
    Byron
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!