Handle Pop-up Dialogs Automatically

8 posts, 0 answers
  1. Mark
    Mark avatar
    22 posts
    Member since:
    May 2011

    Posted 24 Jun 2011 Link to this post

    Hi,

    How can I use the Dialog Handling of the Test Studio to automatically execute itself when it detects an confirmation pop-up dialog? We don't know if the dialog box will show or not.

    Thanks
  2. Ajay
    Ajay avatar
    3 posts
    Member since:
    Jan 2011

    Posted 24 Jun 2011 Link to this post

    HI Mark

    which Types of Dialog should be displayed. you will following below  attached screen short if any clarification  to chat me .
    Eg: one admin (log on )Dialog scenario
    Step 1:http://demos.telerik.com/silverlight/#Controls
    Step 2: Handle "Log on" dialog  in  this step to enter user name and pass word .
  3. Mark
    Mark avatar
    22 posts
    Member since:
    May 2011

    Posted 26 Jun 2011 Link to this post

    Hi Ranjith,

    1. What I mean is that making the Dialog handlers like an Event handler. The scenario is like this. I have already prepared an Dialog handler. Every time there is an dialog box in the test, it will just call/trigger the dialog handler. There is no need to add the a step of an dialog handler.

    2. Additional question: How to handle the pop-up dialog when closing a browser? My test recording fails because it doesn't seem to detect the pop-up dialog. the pop-up dialog only triggers when closing the browser.

    Thanks

  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 29 Jun 2011 Link to this post

    Hello Mark,
           1) Test Studio provides the UnexpectedDialogAction feature. It's only available when running your tests as part of a Test List. It sounds like it's exactly what you need. Check out this article:
    http://www.telerik.com/automated-testing-tools/support/kb/avoiding-dialog-handling-problems-with-the-unexpecteddialogaction-feature.aspx

           2) Depending on the specific type of Dialog we have more than one solution available for this. Check out this thread:
    http://www.telerik.com/automated-testing-tools/community/forums/webui-test-studio-developer-edition/general-discussions/dailog-window-is-popup-while-trying-to-close-browser-after-execute-test-case.aspx

    Let me know if you're having trouble getting any of this to work.

    Greetings,
    Stoich
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
  5. Mark
    Mark avatar
    22 posts
    Member since:
    May 2011

    Posted 29 Jun 2011 Link to this post

    Hi Stoich,

    Thanks for you reply. But are there still any workarounds for this? The only workaround that is working is using the UnexpectedDialogAction.

    Update:
    1. Are there any KB article that uses coded steps to handle this? so that i can configure the handlers to start monitoring pop-ups on before test started?
  6. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 04 Jul 2011 Link to this post

    Hi Mark,
            you can manually set the UnexpecedDialog behavior in code like this:
    Settings.Current.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;
    As you can see this line of code manually access the Settings file associated with the test and sets UnexpectedDialogAction=HandleAndContinue. You can put this coded step at the beginning of each test that will encounter unexpected dialogs. I haven't tested it but this code will probably also work if you put it in OnBeforeTestStarted (reference).

    Please note that when you set the UnexpectedDialogAction in this fashion it will work even for test executions not associated with a TestList per se (e.g. Quick Execution, from CMD usign the ArtOfTest.Runner.exe etc).
    I've attached a test which demonstrates this.

    Greetings,
    Stoich
    the Telerik team
    Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

    Have you looked at the new Online User Guide for Telerik Test Studio?
  7. dan
    dan avatar
    27 posts
    Member since:
    Jun 2016

    Posted 14 Sep in reply to Stoich Link to this post

    Hi Stoich,

    How do I handle unexpected popups if I'm not running the test in a Test List?

    I have a data driven test with mutiple data interations. If the test fails at some point the form under test will have unsaved changes which results in the Internet Explorer's 'Do you want to Leave/Stay' popup when the browser tries to close. When this happens the execution of test iterations grinds to a halt. I need a way to automatically handle the Windows popup when it occurs and then proceed onto the next iteration of the test.  The 'OnBeforeUnload' doesn't help me because it will throw an exception if there is nothing to handle, but I only need to handle the IE popup if there's a verification failure.

     

    Thanks,

    dan

  8. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    253 posts

    Posted 19 Sep Link to this post

    Hello Dan,

    That feature is not included in the UI properties and settings of a single test execution. Though you could accomplish the same behavior but within a coded step. The line of code required is as follows: 

    Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;

    This is in the case when you want the dialog to be handled and continue the execution. 

    Regards,
    Elena Tsvetkova
    Telerik by Progress
     
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top