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

Handle Pop-up Dialogs Automatically

7 Answers 337 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 24 Jun 2011, 07:49 AM
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

7 Answers, 1 is accepted

Sort by
0
Ajay
Top achievements
Rank 1
answered on 24 Jun 2011, 09:06 AM
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 .
0
Mark
Top achievements
Rank 1
answered on 26 Jun 2011, 01:01 PM
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

0
Stoich
Telerik team
answered on 29 Jun 2011, 08:33 AM
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?
0
Mark
Top achievements
Rank 1
answered on 30 Jun 2011, 04:18 AM
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?
0
Stoich
Telerik team
answered on 04 Jul 2011, 09:16 AM
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?
0
dan
Top achievements
Rank 1
answered on 14 Sep 2016, 09:29 PM

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

0
Elena
Telerik team
answered on 19 Sep 2016, 12:39 PM
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!
Tags
General Discussions
Asked by
Mark
Top achievements
Rank 1
Answers by
Ajay
Top achievements
Rank 1
Mark
Top achievements
Rank 1
Stoich
Telerik team
dan
Top achievements
Rank 1
Elena
Telerik team
Share this question
or