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

Internet Explorer 8 Download Finished - Hanging

10 Answers 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 05 Sep 2012, 11:16 PM
We've been having this problem where a test will download a file, the test will succeed and all the other tests in the list will run but when it comes to the end of the list the download complete window stays open and I believe this causes the test studio runner to hang. 

Anyone else have this problem? and maybe a solution? :P

Here is the code:
var dialog = new DownloadDialogsHandler(
                Global.MANAGER.ActiveBrowser,
                (String.IsNullOrWhiteSpace(filePath) ? DialogButton.CANCEL : DialogButton.SAVE),
                (String.IsNullOrWhiteSpace(filePath) ? String.Empty : Global.GetPath(filePath)),
                Global.MANAGER.Desktop
            );
            try
            {
                downloadControl.Click();
                Global.MANAGER.ActiveBrowser.WaitUntilReady();
                dialog.WaitUntilHandled(timeout);
            }
            catch (TimeoutException) {}
            finally {}

10 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 10 Sep 2012, 10:47 PM
Hi Jon,

I am not able to reproduce this problem using your code. Which version of IE are you using? Test Studio is supposed to automatically detect the Download Complete dialog and close it for you. In fact the presence of this dialog is what lets Test Studio know it has finished.

Can you record a video of this problem happening on your machine? Watching the video I might be able to spot where it's going wrong. Jing is a good and free screen recorder.

Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jon
Top achievements
Rank 1
answered on 18 Mar 2013, 06:15 PM
Hi Cody

Sorry for the huge delay on responding. As we made some significant changes to our test infrastructure this issue was put on the back burner.

We seem to be having this issue across a lot of IE versions when run inside a VM. My thoughts are that it could be a setting issue. I'm still using the same code that I originally posted. I have created a Jing video for you, (feel free to ignore everything before the first minute, that is the method I used for testing our tests on a VM).

http://screencast.com/t/nlbABGOa0Z

As you will see in the video it clicks the download link, the download dialogue opens, and just sits there. I set the delays to be massive but eventually it fails with a timeout exception.

If you could give me some insights on how I could fix this that would be marvelous!

Thanks
Jon
0
Jon
Top achievements
Rank 1
answered on 18 Mar 2013, 07:05 PM
I've think I've found a kludge fix, if I put a 10 second execution delay before the code posted above, in the form of a Execution delay step.

I can't seem to figure out why this works, at first I thought it was because there is a full post back to get the correct file. I tried a wait for URL and it didn't work. Hopefully you guys can shed some light on this issue for me.

Cheers
Jon
0
Cody
Telerik team
answered on 19 Mar 2013, 02:02 AM
Hi Jon,

I cannot explain why adding an Execution Delay would help. I did just notice something about your code (I should have spotted this earlier). I would like you to comment out this line:

Global.MANAGER.ActiveBrowser.WaitUntilReady();

It actually may be interfering with the dialog.WaitUntilHandled.

If that doesn't help I'd like to look at this problem via GoToMeeting.

Regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jon
Top achievements
Rank 1
answered on 20 Mar 2013, 05:10 PM
Hi Cody

Unfortunately that didn't seem to do the trick.
I'm available all day today, and friday.

Cheers
Jon
jon[at]scorpionsoft.com
0
Cody
Telerik team
answered on 20 Mar 2013, 05:17 PM
Hi Jon,

I see. How about 3pm CDT today?

1.  Please join my meeting, Wednesday, March 20, 2013 at 3:00 PM Central Daylight Time.
https://www2.gotomeeting.com/join/600236026

2.  Use your microphone and speakers (VoIP) - a headset is recommended.  Or, call in using your telephone.

Dial +1 (267) 507-0012
Access Code: 600-236-026
Audio PIN: Shown after joining the meeting

Meeting ID: 600-236-026


Kind regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jon
Top achievements
Rank 1
answered on 20 Mar 2013, 05:26 PM
That sounds good.

Thanks
Jon
0
Cody
Telerik team
answered on 20 Mar 2013, 08:52 PM
Hi Jon,

Just to summarize the outcome of our meeting... I noticed that your application is using an "accordion" type of control on the web page. It's important that the test script synchronize with the accordion finishing it's animation before moving to the next step of the test. This explains why the script runs fine on your local fast machine (it may even be intermittent on that machine) and only work with a fixed 5 second delay on the slower VM.

You were going to investigate how to synchronize with this animation. Maybe there's an event handler you can hook into that indicates the animation is finished. Let us know what (if anything) you come up with.

I am closing this ticket for now. You can reopen it in the future if/when appropriate.

All the best,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Jon
Top achievements
Rank 1
answered on 20 Mar 2013, 09:48 PM
Hi Cody

After further investigation, I've found that the rendering speed on IE9 is not very good. I've found a javascript event listener that will notify me when the animation is complete (attached below). Though I'm not sure how I'm going to figure out a way to pass this event back to the C# code so that I can notify the tests to continue. If you have any ideas on how I can create a callback to my code that would be great.

Thanks again for spending the time with me today! It was a pleasure!

Cheers
Jon

$( ".selector" ).on( "accordionactivate", function( event, ui ) {} );
/* http://api.jqueryui.com/accordion/ */
0
Cody
Telerik team
answered on 20 Mar 2013, 11:10 PM
Hello Jon,

Yes we have a method of activating .NET event handlers from JavaScript events. Look in the section JavaScript Event Handlers on this page. Let me know how it goes.

Greetings,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Jon
Top achievements
Rank 1
Answers by
Cody
Telerik team
Jon
Top achievements
Rank 1
Share this question
or