MainWin.
Closes all windows of the application except the main window.
mainwin.CloseWindows ([bTrace])
Variable | Description |
---|---|
bTrace | Optional: TRUE to print a log in the results file of all windows closed; FALSE (default) not to print the log. BOOLEAN. |
CloseWindows starts with the current active window and attempts to close it using the following sequence, stopping when the window closes:
If a Close method is defined for the window, call it . Even if this method does not close the window, none of the following steps are executed.
Call window.CloseBox.Click()(for Windows).
Call window.SysMenu.Close.Pick() (on platforms and windows that have system menus).
If the window is a dialog, type the keys specified in OPT_CLOSE_DIALOG_KEYS and wait one second for the dialog to close.
If there is a single button in the window, click that button.
Click the list of buttons specified with OPT_CLOSE_WINDOW_BUTTONS.
Select the menus specified with OPT_CLOSE_WINDOW_MENUS.
Once one window closes, CloseWindows follow the sequence with the next window, until all windows are closed.
If closing any window causes the application to display a confirmation dialog, CloseWindows attempts to close the dialog using the list of buttons specified with the OPT_CLOSE_CONFIRM_BUTTONS option.
This method supports several specifications you can make to help Silk Test Classic close a window:
To specify | Set this option | Or set this variable |
---|---|---|
Non-standard buttons to use to close confirmation dialog | OPT_CLOSE_CONFIRM_BUTTONS | lsCloseConfirmButtons |
If the UI of the application is in English, you only need to specify non-standard buttons that are used to close the window. If the UI of the application is not in English, you need to replace all strings, which correspond to buttons that are used to close a window, with the localized strings. | OPT_CLOSE_WINDOW_BUTTONS | lsCloseWindowButtons |
If the UI of the application is in English, you only need to specify non-standard menu items that are used to close the window. If the UI of the application is not in English, you need to replace all strings, which correspond to menu items that are used to close a window, with the localized strings. | OPT_CLOSE_WINDOW_MENUS | lsCloseWindowMenus |
Non-standard keys to type to close the window, if it is a dialog. | OPT_CLOSE_DIALOG_KEYS | lsCloseDialogKeys |
You can make these specification by using the SetOption method, by defining the specified variable, or using the settings in the Close tab of the Agent Options dialog box.
[ ] RecoverBaseState () [ ] TextEditor.CloseWindows () [ ] ClearFile () [-] do [ ] VerifyBaseState () [-] except [ ] LogError ("Error: Can’t return to base state") [ ] TextEditor.Exit () [ ] TextEditor.Invoke ()