'OnBeforeUnload' dialog handler doesn't work when running test tool on (minimized) Remote desktop

4 posts, 0 answers
  1. Arnout
    Arnout avatar
    4 posts
    Member since:
    Mar 2013

    Posted 29 Mar 2013 Link to this post

    Hello,

    I’m currently using the Visual Studio plugin of the Telerik Web Test tool (version 2012.2.1204.0) to run tests on a user-based website that spawns a scripted ‘onbeforeunload’ dialog box when navigating to another URL. As this website doesn’t have designated logout functionality, navigating to another URL is the only way to logout.

    Handling this dialog box can be done by the ‘OnBeforeUnload’ functionality included in the test tool. This generally works fine, but I ran into some problems when running my tests on a remote desktop when the remote desktop connection is minimized.

    I’m not a through-and-through experienced c# user so correct me if I’m wrong, but what I think I’ve seen in the OnBeforeUnload method (ArtOfTest.WebAii.Dialogs.OnBeforeUnloadDialog.cs) in combination with my experience with this tool, is that when the active (parent) browser doesn’t have user focus this method tries to restore this focus, after which it tries to invoke or simulate some user actions like ‘press escape’ or ‘enter’ using the user keyboard (via the desktop.KeyBoard.KeyPress method) in order to handle the dialog box.

    This doesn’t work too well with a remote desktop though. When the remote desktop connection utility is minimized the keypress method cannot acces any of the user's input devises, and so the dialogbox isn't handled (and remains stuck/not-handled), thus making running my tests impossible.

    My question is this:

    How do I handle the ‘on before unload’ dialog box under these conditions? Is there any way to do it without invoking an input device?

        • Something that (hopefully) makes it easier in this specific case to solve this issue is that I do not particularly care which option is selected in this dialog box, as long as it is either handled or forced to close.

    Thanks in advance for your time and help.

    Kind regards,

    Arnout

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 29 Mar 2013 Link to this post

    Hi Arnout,

    In order to run tests on a remote machine using RDP while the window is minimized, you will need to add certain registry keys to the remote machine.

    Please let us know if we can assist you further.

    Regards,
    Plamen
    the Telerik team
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
  3. Arnout
    Arnout avatar
    4 posts
    Member since:
    Mar 2013

    Posted 29 Mar 2013 Link to this post

    Thanks Plamen, this was indeed the cause of the problem. :-)

    Kind regards,

    Arnout
  4. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 29 Mar 2013 Link to this post

    Hello Arnout,

    Glad to hear it! Thanks for the update.

    All the best,
    Plamen
    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!