Specifying Windows to be Left Open for Tests that Use the Classic Agent

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 lwLeaveOpen constant.

lwLeaveOpen constant

When you record and paste the declarations for your application’s main window, the stub of a declaration for the lwLeaveOpen constant is automatically included, as shown in this example:

// The list of windows the recovery system is to leave open
// const lwLeaveOpen = {?}

To complete the declaration for the lwLeaveOpen constant:

  1. Replace the question mark in the comment with the 4Test identifiers of the windows you want to be left open. Separate each identifier with a comma.
  2. Remove the comment characters (the two forward slash characters) at the beginning of the declaration.

Example

he following 4Test code shows how to set the lwLeaveOpen constant so that the recovery system leaves open the window with the 4Test identifier DocumentWindow when it restores the base state.

const lwLeaveOpen = {DocumentWindow}