MoveableWin.
Closes the window.
window.Close ([bConfirm, bSetActive])
Variable | Description |
---|---|
bConfirm | Optional: TRUE to close confirmation dialogs that may pop up when closing the window; FALSE (default) to raise an exception if a confirmation dialog pops up. BOOLEAN. |
bSetActive | Optional: TRUE to issue window.SetActive before attempting to close window. FALSE (default) to close without attempting to set window active. BOOLEAN. |
The Close method attempts to close the window by trying the following events, in this sequence, stopping when the window closes:
Close may fail. For example, if closing a window causes the application to display a message box and bCloseConfirm is set to FALSE, or if the buttons used to close the message box are not covered under the OPT_CLOSE_CONFIRM_BUTTONS option, the call will fail and raise the exception E_CANT_CLOSE_WINDOW.
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 boxes | OPT_CLOSE_CONFIRM_BUTTONS | lsCloseConfirmButtons |
Non-standard buttons to use to close the window | OPT_CLOSE_WINDOW_BUTTONS | lsCloseWindowButtons |
Non-standard menu items to use to close the window | OPT_CLOSE_WINDOW_MENUS | lsCloseWindowMenus |
Non-standard keys to type to close the window, if it is a dialog box | OPT_CLOSE_DIALOG_KEYS | lsCloseDialogKeys |
You can make these specification, either by using the SetOption method, by defining the specified variable, or using the settings in the Close tab of the Agent Options dialog box.
// Set the line number in GotoLine dialog to a string GotoLine.LineNumber.SetText ("A") GotoLine.Accept () // TextEditor displays a message box MessageBox.Message.Verify ("Must enter a number.") // close the message box MessageBox.Close ()