By default, the non-Web recovery system closes all windows in your test application except the main window. To specify which windows, if any, need to be left open — such as a child window that is always open — use the lwLeaveOpenWindows or lsLeaveOpenLocators constant.
When you record and paste the declarations for your application’s main window, the stub of a declaration for the lwLeaveOpenWindows constant is automatically included. Additionally, it is possible to specify windows to leave open by using XPath locator strings. These can be specified with the variable lsLeaveOpenLocators, which must be a list of strings. The following example shows the lwLeaveOpenWindows and lsLeaveOpenLocators constants before they have been edited:
// The list of windows the recovery system is to leave open // const lwLeaveOpenWindows = {?} // const lsLeaveOpenLocators = {?}
To complete the declaration for these constants:
Remove the comment characters (the two forward slash characters) at the beginning of the lwLeaveOpenWindows declaration.
For example, the following code shows how to set the lwLeaveOpenWindows constant so that the recovery system leaves open the window with the identifier DocumentWindow when it restores the BaseState.
const lwLeaveOpenWindows = {DocumentWindow}
Remove the comment characters (the two forward slash characters) at the beginning of the lsLeaveOpenLocators declaration.
For example, the following code shows how to set the lsLeaveOpenLocators constant so that the recovery system leaves open the About dialog box when it restores the BaseState.
lsLeaveOpenLocators = {“/MainWin[@caption=’*Information*’]”, “//Dialog[@caption=’About’]”}