Clearing unexpected message boxes

2 posts, 0 answers
  1. Dennis
    Dennis avatar
    24 posts
    Member since:
    May 2014

    Posted 04 Feb 2016 Link to this post

    Is there a way to clear unexpected browser message boxes that might display when running an automated test?

    Occasionally, our AUT will display a message box if the test fires an event before the UI is ready. The message box causes the test to hang and this prevents subsequent tests from running.

    Granted, this is a timing issue between our web site and the test that needs to be addressed, but I was thinking a test as a step could be added to each test to automatically clear any hanging message boxes if they should appear unexpectedly. This would keep our tests running on daily basis as we address the timing issues.

    I've used a function in another testing tool, but I'm not sure how to accomplish this in a test as a step in Test Studio, so any suggestions would be appreciated!

  2. Nikolay Petrov
    Nikolay Petrov avatar
    308 posts

    Posted 09 Feb 2016 Link to this post

    Hello Dennis,

    If you use test list and you don't want to handle this dialog at all you can set the UnexpectedDialogAction to HandleAndContinue. In this case Test Studio will just close this dialog. You should not have a DailogHandling step for that dialog.

    In order to set it in a single test, not in a test list, you should add a coded step as the very first one with the following code:

    Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;

    Let me know if that helps.

    Nikolay Petrov
    The New Release of Telerik Test Studio Is Here! Download, install,
    and send us your feedback!
Back to Top