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

DownloadDialogsHandler not working after libraries upgrade

6 Answers 127 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
aplicaciones
Top achievements
Rank 1
aplicaciones asked on 01 Feb 2019, 11:08 AM

Hello,

I have seen previous posts about this but they are quite old. So, I preferred to create a new one just in case.

I had a test with Telerik  ArtOfTest.WebAii version 2017.3.1206.0. It has been working perfectly fine for months.
Last week I had to do a minor change to something unrelated to this issue and I decided to upgrade to version 2018.3.1004.

The browser being used is IE 11.2125 (English version)

            handler.WaitUntilHandled(35000);
After doing this upgrade the Download Dialog handler stop working as it used to do. So, I got the timeout exception because the Dialog is no longer getting handled.

Here I put the code but I haven't modified this. I just put it if there is something extra that I should be doing:


                DownloadDialogsHandler handler = new DownloadDialogsHandler(manager.ActiveBrowser, DialogButton.SAVE, atestadoSavedLocation, manager.Desktop);

            //Trigger the dialog.
            manager.DialogMonitor.Start();

            clickDescargar.Invoke(); //triggers the download

            handler.WaitUntilHandled(35000);


Could you give me any hint on how to sort this out?
Regards,
Sebastian

6 Answers, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 01 Feb 2019, 02:16 PM
Hello Sebastian,

Thank you for contacting us and providing your environment details.

After analyzing your code example I researched what changes have been included between those 2 releases. I believe that the problem is related to a missing assembly reference, caused by the update. The good news is that I have the some suggestions, which should help you.
  • There is an issue with missing assembly in Test Studio framework, please check this forum thread and try to add Telerik.TestStudio.DialogMatches.dll manually. For additional information see also how to add reference in Visual Studio. The problem is already fixed in the upcoming release and the assembly will be added automatically during update.
  • You can try and call the Manager with capital M like so - Manager.ActiveBrowse. The code, which you have provided, is not compiling for me and this change fixed it.
  • You can replace the parameter atestadoSavedLocation with a string, for example @"C:\[filename.extension]" depending on the file you are saving. Note that you will need permissions to write in the specified drive.

In case those suggestions don't result in successful execution, can you please attach the output from Visual Studio with selected Show output from - Test Studio.

Please don't hesitate to contact us.

Regards,
Plamen Mitrev
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
aplicaciones
Top achievements
Rank 1
answered on 22 Feb 2019, 09:14 AM

Hello Plamen,

Sorry for the delay in my response and many thanks for your answer. 
On that moment I had to put in production the test so I downgraded to version 2017.3.1206.0. and everything worked fine.

Now that I have time I have just added the missing assembly and everything worked as expected. So, thanks for that.

The code that I provided to you was just a part of a bigger class that has Manager as a member. So, in my case was not a problem of compiling. The issue was at runtime that it didn't handle the Dialog and that was fixed as soon as I added manually the reference that you mentioned.

Thanks for your time and help.

Sebastian .


0
aplicaciones
Top achievements
Rank 1
answered on 22 Feb 2019, 12:55 PM

Hello,

It's me again :(

Thanks to your advice now the file is downloaded properly but unfortunately the

handler.WaitUntilHandled(35000);

throws the following exception:

System.TimeoutException: Timed out waiting '35000' msec. for any dialog to be handled '1

On IE I have configured the "Notify me when my downloads are complete" to be ON.

The code is the one that I posted in the original question.
Something to mention is that whenever I click the button that triggers the Download a new pop window is open.
I guess that might be the issue.

Regards,
Sebastian

 

0
Plamen Mitrev
Telerik team
answered on 22 Feb 2019, 03:20 PM
Hello Sebastian,

I am happy to hear that the behavior has improved, after adding the assembly. As mentioned before, this issue is fixed in the latest release and the assembly is added during the update.

The TimeoutException, that you are now experiencing, indicates that either 35000ms is not sufficient to finish the download, or that the dialog is not handled correctly. Depending on the size of the file, you can increase this time and try again. In case this does not resolve the error, here are some suggestions and additional questions, which might help us understand what is happening.
  • I assumed that the provided code was part of the whole class and in that case the logic seems to be correct. However, this code will only handle the download dialog and  in case you see an additional dialog before or after that, this might result in test failure.
  • Can you please share screenshots of the pop up windows that appears during execution? You can also enable the annotations, before you execute the test, as this will make it easier to troubleshoot and understand the behavior of your test.
  • Please try running the same test against Chrome, Firefox and IE to compare the behavior and let me know if there is a difference in the results. Do you see different download dialogs or other windows in the different browsers?

The information will allow us to investigate this further and help you resolve the issue.

Regards,
Plamen Mitrev
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
aplicaciones
Top achievements
Rank 1
answered on 26 Feb 2019, 10:34 AM

Hi Plamen,
Firstly, thanks again for your help. Let me depict better the scenario by answering your comments:

"The TimeoutException, that you are now experiencing, indicates that either 35000ms is not sufficient to finish the download, or that the dialog is not handled correctly." --> The time is more than enough as the file (now that I manually added the missing assembly) it gets always downloaded. The issue is that the "handler.WaitUntilHandled(35000);" still throws an exception. 

So, to be clear on this: the file is correctly downloaded but I still get the timeout exception.

I have attached you a screenshot. Again, the file is properly downloaded (Saved).
I can't enable annotations as I have converted the Test to Unit Test for other reasons. So, all my steps are "coded steps".
Even if I could run the same Test against Chrome and Firefox my requirement is to run it only on IE.

I have been able to download the file and continue with the Test doing a workaround but I would like to do it without this.
Just in case I share that part of the code.
>  private void LaunchDownloadHandler(string , Action clickAction, int )
        {
            WriteInformationEvent(System.Reflection.MethodBase.GetCurrentMethod().Name);

            DownloadDialogsHandler handler = null;
            try
            {
                handler = new DownloadDialogsHandler(Manager.ActiveBrowser, DialogButton.SAVE, savedLocation, Manager.Desktop);

                // You need to invoke the monitoring
                Manager.Current.DialogMonitor.Start();

                //Triggers the PopUp
                clickAction.Invoke();  //Clicks the button that triggers the Popup & Download to start

                handler.WaitUntilHandled(timeOut);
            }
            catch (Exception e) //Here I catch the TimeOutException
            {
                //TODO: Create an Alerta
                WriteErrorEvent(e.Message);

                ClosePopUp(); //Method that look for the last browser instance and closes it
            }
            finally
            {
                handler = null;
                if (Manager.Current.DialogMonitor.IsMonitoring)
                    Manager.Current.DialogMonitor.Stop();
            }
        }

In addition, I have attached you the Test excecution output in case it provides you more insight on this.

Best regards,
Sebastian

0
Plamen Mitrev
Telerik team
answered on 01 Mar 2019, 09:51 AM
Hi Sebastian,

The log file and screen shot provided valuable information, which might lead us to fixing the misbehavior.

I see from the log that "IEDownloadDialog" is never handled by Test Studio and I assume that you do not see this dialog (see attached screenshot), during execution and this is why I assume that Internet Explorer is not calibrated correctly on the execution machine. Can you please check the status from the calibrate browsers button in Test Studio? In case IE is Calibrated, please click on Restore and Calibrate, anyway, to make sure it is recalibrated, as some browser/windows updates might mess that up? Before you test again, you can remove the catch from your code and verify if the above suggestion helped.

Something else, you can try, is to create new web test and record a simple scenario to download a file from the application, without using coded steps. Let me know if that is possible and what is the observer result when you execute this test. Is it any different from the test with the coded steps and how is it different?

In case you actually see the mentioned dialog with a calibrated browser and you continue to experience this misbehavior, I would like to ask you to record a short video of the execution. This will help us understand what is happening and which dialogs are handled during execution. In case the video might contain any private or sensitive information, please let me know I can convert this thread to a private one.

The dialog we see in the attached screenshot should not cause this TimeOutException. We will try to reproduce that on our end and further analyze this behavior.

I hope that the above information will help you with the troubles. Thank you for your cooperation.

Regards,
Plamen Mitrev
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
aplicaciones
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
aplicaciones
Top achievements
Rank 1
Share this question
or