More than a single dialog is invoked in an application. I need to dismiss all except the MainWindow. Most of the dialogs are modal.
I am able to dismiss the first (top most). After I dismiss the first one I need to get the next window active for the Application Under Test and dismiss it.
I have tried the following:
MainWin.GetCloseWindows () and MainWin.GetNextCloseWindowExample ()
Sometimes the GetActive call returns one of the controls within the window as active. For e.g. a PushButton or RadioList. For this I tried
CurrentActiveWindow.GetParent () to get the dialogbox to dismiss. the call fails. Also tried it with the wParent property.
The GetAcitve call sometimes returns one of the Parent Dialogs as active. Even though the child dialog is still present. Problem is the dialogs are modal.
Also wrapped up all the calls above in a Do Except. None seems to help.
SilkTest 126.96.36.199 (Client does not want to upgrade), Win2k, application is a Windows Desktop.
The app is developed in VC ++. The GetNextCloseWindow (), or any other (GetActive, GetChildren) calls fail, I guess the reason being that the window that is active is either a control within the dialogbox (sometimes the parent and not the one that is currently on top) or maybe the parent dialog itself. I have no idea why this is so.
I thought the reason must have been the declarations that were created. Since in many of the dialog declarations I have elevated the controls (pushbutton, Radiolists etc) of the child dialog to the parent by appending the tags. But I cross checked this and I am absolutely sure that this is not the problem.
I also tried the Typekeys ("<Alt-F4>"), but tried it on the window returned with the GetActive or GetChildren call. Still nothing.
Now I think I will try out this, I will wrap up the GetCloseWindow and GetNextCloseWindow calls in a do except loop. In the except I will dismiss everything with a Desktop.Typekeys ("<Alt-F4>") until only the Main win is left.
One other thing, sometimes the active window returned from the GetActive calls is a window which is not present at all. I don't know how to handle this one.