I am testing something in a window where the parent might differ depending on how I "entered" the dialog I am testing.
I can get to the Testdialog in two ways:
1. dialog1 - dialog2 – TestDialog
2. dialog1 - TestDialog
For 1. the parent will be dialog2 and for 2. the parent will be dialog1
How can I dynamically declare the parent in the window declaration for the window I am testing?
I have tried using a variable that I can change depending on the current parent window to the test window: E.g.
There is a problem with your WINDOW wParent if you simply try and assign another window to it, such as:
wParent = dialog2
The compiler will probably complain that wParent is not a window, and indeed it is not, it is a reference to a window.
So if you make wParent an actual window and set its tag to the same tag as dialog2, then the compiler will be happy:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">window MainWin wParent
tag "dialog2's actual tag"</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">However this does not help you very much but it gives you a clue
So, try creating a dummy window whose tag is a function call which simply returns a global variable. Use this dummy window as the parent for TestDialog.
So, you simply set the global variable to the tag of dialog1 or dialog2... and then when you reference TestDialog it should work.
Always remember with Silktest, a window and a reference to a window are not interchangable things.