Dialog Box Loop Problem
Posted: Tue Mar 28, 2017 4:33 pm
Hi,
My AUT has a dialog box which appears at a couple of different times for different reasons. The form is the same but the title bar is different. I do not want to use the popup watcher since I'd like to know when these dialogs are encountered and handled. I have written a small user code method which catches the condition but, due to my inadequate C# coding skills, it continues to have issues:
In my AUT it is not uncommon for this dialog box to appear and, after I click the button to dismiss it, appear again for the same reason as its first appearance; this is not unexpected but, also, not always the case.
The way that my method is working right now is that the first dialog is caught, dealt with, the second dialog if it exists is caught and dealt with... but then it continues to look for the dialog until my test case eventually fails since it cannot be found.
Could someone please tell me what I'm doing wrong; I'm sure that it's probably something simple that I'm missing.
Thanks.
My AUT has a dialog box which appears at a couple of different times for different reasons. The form is the same but the title bar is different. I do not want to use the popup watcher since I'd like to know when these dialogs are encountered and handled. I have written a small user code method which catches the condition but, due to my inadequate C# coding skills, it continues to have issues:
In my AUT it is not uncommon for this dialog box to appear and, after I click the button to dismiss it, appear again for the same reason as its first appearance; this is not unexpected but, also, not always the case.
The way that my method is working right now is that the first dialog is caught, dealt with, the second dialog if it exists is caught and dealt with... but then it continues to look for the dialog until my test case eventually fails since it cannot be found.
Could someone please tell me what I'm doing wrong; I'm sure that it's probably something simple that I'm missing.
Thanks.
Code: Select all
[language=csharp]
public void Wait_For_Popup()
{
Report.Log(ReportLevel.Info, "Wait", "Waiting for item 'GenericDialog' to be visible.");
while (repo.GenericDialog.Self.Visible == true)
{
switch (repo.Generic.Self.Title.ToString())
{
case "DialogOne":
repo.DialogOne.ButtonUniqueToDialogOne.Click();
Report.Info("Clicked Dialog One Button");
break;
case "DialogTwo":
repo.DialogTwo.ButtonUniqueToDialogTwo.Click();
Report.Info("Clicked Dialog Two Buggon");
break;
default:
break;
}
}
}
[/language]