4Test provides two equivalent ways to invoke a dialog box:
- Use the
Pick method to pick the menu item that invokes the dialog box. For example:
TextEditor.File.Open.Pick ()
- Use the
Invoke method:
Open.Invoke ()
While both are equivalent, using the
Invoke method makes your test cases more maintainable. For example, if the menu pick changes, you only have to change it in your window declarations, not in any of your test cases.
The Invoke method
To use the
Invoke method, you should specify the
wInvoke variable of the dialog box. The variable contains the identifier of the menu item or button that invokes the dialog box. For example:
window DialogBox Open
tag "Open"
parent TextEditor
WINDOW wInvoke = TextEditor.File.Open