This is a migrated thread and some comments may be shown as answers.

File download window

16 Answers 211 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ninja
Top achievements
Rank 1
Ninja asked on 23 Mar 2012, 12:01 PM
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

16 Answers, 1 is accepted

Sort by
0
Anthony
Telerik team
answered on 23 Mar 2012, 02:48 PM
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
0
Ninja
Top achievements
Rank 1
answered on 23 Mar 2012, 03:35 PM
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
0
Anthony
Telerik team
answered on 23 Mar 2012, 04:35 PM
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
0
Ninja
Top achievements
Rank 1
answered on 24 Mar 2012, 12:52 PM
Hi Anthony,

Download Dialog handler is not handling 1.PNG & 3.PNG
0
Anthony
Telerik team
answered on 26 Mar 2012, 03:22 PM
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
0
Ninja
Top achievements
Rank 1
answered on 03 Apr 2012, 11:34 AM
Anthony,

With IE8 sometimes dialogs one and two are also not getting handled, some times it is handling some times not.
0
Anthony
Telerik team
answered on 03 Apr 2012, 05:35 PM
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
0
John
Top achievements
Rank 1
answered on 10 Apr 2012, 07:53 AM
Anthony,

After handling download dialog through Dialog Handler does Test Studio also checks whether the file is actually downloaded to physical location?
0
N1t1nA
Top achievements
Rank 1
answered on 10 Apr 2012, 08:20 AM
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);       
            }
        }





0
Byron
Telerik team
answered on 10 Apr 2012, 05:44 PM
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
0
John
Top achievements
Rank 1
answered on 22 Apr 2012, 09:59 AM
@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?
0
Byron
Telerik team
answered on 23 Apr 2012, 08:04 PM
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
0
John
Top achievements
Rank 1
answered on 26 Apr 2012, 02:40 PM
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?
0
Byron
Telerik team
answered on 26 Apr 2012, 11:40 PM
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
0
Rupesh
Top achievements
Rank 1
answered on 14 Jun 2012, 09:24 AM
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?
0
Byron
Telerik team
answered on 15 Jun 2012, 07:24 PM
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
Tags
General Discussions
Asked by
Ninja
Top achievements
Rank 1
Answers by
Anthony
Telerik team
Ninja
Top achievements
Rank 1
John
Top achievements
Rank 1
N1t1nA
Top achievements
Rank 1
Byron
Telerik team
Rupesh
Top achievements
Rank 1
Share this question
or