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

Clearing unexpected message boxes

1 Answer 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 04 Feb 2016, 07:42 PM

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!

1 Answer, 1 is accepted

Sort by
0
Nikolay Petrov
Telerik team
answered on 09 Feb 2016, 01:24 PM
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.

Regards,
Nikolay Petrov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Dennis
Top achievements
Rank 1
Answers by
Nikolay Petrov
Telerik team
Share this question
or