Internet Explorer 8 Download Finished - Hanging

11 posts, 0 answers
  1. Jon
    Jon avatar
    55 posts
    Member since:
    May 2012

    Posted 05 Sep 2012 Link to this post

    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 {}
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 10 Sep 2012 Link to this post

    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
  3. Jon
    Jon avatar
    55 posts
    Member since:
    May 2012

    Posted 18 Mar 2013 Link to this post

    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
  4. Jon
    Jon avatar
    55 posts
    Member since:
    May 2012

    Posted 18 Mar 2013 Link to this post

    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
  5. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 18 Mar 2013 Link to this post

    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
  6. Jon
    Jon avatar
    55 posts
    Member since:
    May 2012

    Posted 20 Mar 2013 Link to this post

    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
  7. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 20 Mar 2013 Link to this post

    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
  8. Jon
    Jon avatar
    55 posts
    Member since:
    May 2012

    Posted 20 Mar 2013 Link to this post

    That sounds good.

    Thanks
    Jon
  9. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 20 Mar 2013 Link to this post

    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
  10. Jon
    Jon avatar
    55 posts
    Member since:
    May 2012

    Posted 20 Mar 2013 Link to this post

    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/ */
  11. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 20 Mar 2013 Link to this post

    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
Back to Top