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

Unexpected Dialog Handling

5 Answers 168 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aswin
Top achievements
Rank 2
Aswin asked on 07 Mar 2013, 12:18 PM
Hi ! I have an issue in my Web Test (For Silverlight powered site). 

After a particular step, there is a Dialog box popping up and hence the whole test fails. Big problem is the occurrence of Dialog box is not constant. So can I create an If-Else loop likewise to handle this.

So if I place the If-Else loop after the particular step, If the dialog box comes, It has to click ok and Continue, or else it has to proceed as usual. Can anyone help me in regard of this...? Thank you...

I hope I made my problem clear. If not, Let me know. I can explain More...

P.S: I know exactly after which step the dialog may popup. 

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Mar 2013, 12:29 PM
Hello Aswin,

I am sorry to hear you are running into this problem. Unfortunately a standard IF/ELSE logical step added through the UI will not work in this case. This can be done in a coded step however. Please see this article on "Conditional Dialog Handling" and let me know if you need further assistance on this.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Aswin
Top achievements
Rank 2
answered on 07 Mar 2013, 12:36 PM
Thanks for the Reply. But the action that potentially triggers the dialog is not available. I don't know why it arises. Moreover this testing is for Silverlight app embedded site and thus making it more complicated to Handle. It'll be wonderful if UI has a solution or Work-Around something like that.
0
Accepted
Plamen
Telerik team
answered on 11 Mar 2013, 04:35 PM
Hi Aswin,

Unfortunately as I stated before conditional dialog handling can only be done in code. The problem is that the test displays the dialog before it enters the If/Else statement. The Dialog Handler isn't created until the branch is made and since the dialog is displayed before the dialog handler is created, it will never know that the dialog exists.

One thing you can try however is to set the UnexpectedDialogAction property to HandleAndContinue. This should handle all unexpected dialogs automatically when they show up.  

In order to set this property when executing from 'Quick Execution', you can override it in a coded step like this:
Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.HandleAndContinue;


Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Ola
Top achievements
Rank 1
answered on 23 Sep 2017, 12:39 AM

I know this is an old thread but i found in on the web search for a solution, I am having an error involving an unexpected dialoge according to the error report.

I tried the line of code mentioned, but it doesn't work.

I am new, and just trying to run the sample project called htmlcontrols.cs, where is this files, from the telerik sample should i place the code, or is it irrelevant

 

Thanks

0
Nikolay Petrov
Telerik team
answered on 27 Sep 2017, 01:41 PM
Hi Ola,

Please provide a sample testing project on a public facing application that reproduce this problem to investigate further.

Thank you in advance for your cooperation.

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