Record Window Declarations Dialog Box

This functionality is supported only if you are using the Classic Agent.

Use the Record Window Declarations dialog box to record descriptions, called window declarations, of the GUI objects in your application and insert them into a declarations file, called an include file (*.inc).

Click Record > Window Declarations.

The declaration is a combination of class, identifier, and tag. As you move the mouse over your application, the contents of the dialog box change to reflect the object under the mouse. When you position the mouse over the object you want to declare and press Ctrl+Alt, the Record Window Declarations dialog box freezes the current contents, in effect, taking a snapshot of the declaration.

Silk Test Classic references the declarations in the include file to identify the objects named in your test scripts. You tell Silk Test Classic which include file(s) to reference through the Use Files field in the Runtime Options dialog box.

Window detail area

The Window Detail area displays the class, identifier, and tag of the object selected in the Window Declaration list and is used to edit the class and identifier of an object.

Class
The class is the GUI object type and determines which methods can operate on the object.
Identifier
The identifier is a unique and logical, generalized platform-independent name for referring to an object. The identifier is the name you use to refer to an object in your test case. It is arbitrary—you can use any unique identifier you want for an object. By default Silk Test Classic constructs the identifier from the object’s label or caption, removing any embedded spaces or accelerators. You can edit the identifier, for example, to make it more descriptive. The change will be reflected in the list box. To change the default identifier, see Options.
Tag
Not modifiable. A tag is the actual internal name that Silk Test Classic uses to refer to an object. By default, Silk Test Classic constructs the tag from the caption and Window ID of the object. You can also construct the tag from other components of the object in the Tag information area. You can use the Record Windows Declarations Options dialog box to change how Silk Test Classic constructs the default tag.
Class Map
Click to open the Class Map dialog box. Use this dialog box to change the class of a custom object. For additional information, see Perform a Class Mapping when a Declaration for a CustomWin Appears in the Record Window Declaration Dialog.

Tag information area

The Tag Information area displays the components that Silk Test Classic can use to construct the tag for the object. Once you have paused tracking, Silk Test Classic displays the information for the currently selected object in the Window declaration list box. Check the corresponding check box for the components that you want Silk Test Classic to use. By default, Caption, Window ID, and Attributes are checked.

To edit the tag information, first select the object in the Window declaration list box and then edit the tag information for the component in the corresponding field.

Caption
Caption or label as it appears to the user.
Prior text
The closest static text above or to the left of the object. You must use the ^ character to preface a prior text tag.
Index
The order, from top left to bottom right, in relation to other sibling objects of the same class. You must use the # character to preface an index tag.
Window ID
GUI-specific ID. You must use the $ character to preface a window ID tag.
Location
The physical location, expressed as a pair of (x, y) coordinates. You must use the @ character to preface a location tag.
Attributes

Any HTML attribute you want to record, including custom attributes. You may use the ? and * wildcards in attribute values. The * character matches zero or more characters. The ? character matches exactly one character. The following characters are not allowed in attribute names: (space) ~`!@#$%^&*()_-+={[}]|\:;"’<,>.?/

The values of attributes have been tested for up to 900 characters and there is a limit of 4096 characters for the total number of characters you can paste or type into the Attributes field.

General

Keep on top
When checked, the Record Window Declarations dialog box is kept in the foreground even when you are tracking the cursor over your application. By default, this check box is checked.
Edit Class Attributes...
Click to display the Edit Class Attributes dialog box, where you can select the attributes you want to record for HTML objects when you record window declarations and play back test scripts. To maintain backward compatibility, recording attributes is turned off by default. For additional information, see Edit Class Attributes dialog.

Buttons

Resume Tracking
Click to resume tracking. After pasting declarations into the editor, when you are ready to record another declaration, click Resume Tracking.
Paste to Editor
Click to insert the "frozen" declarations in the Window Declaration list box into the active script or include file. If neither an include nor script file is active, Silk Test Classic creates and pastes the declaration to an untitled include file. The Record Window Declarations dialog box is cleared. Each time you select Paste to Editor, Silk Test Classic inserts the declarations at the end of the same file. You can paste up to 4096 characters.
Copy to Clipboard

Use instead of Paste to Editor, if you want to paste declarations elsewhere in the file or if you write your test scripts with another editor than the one provided with Silk Test Classic.

Click to copy the declarations in the list box to the clipboard. The Record Window Declarations dialog box is cleared. Use Edit > Paste to insert the declarations into a different editing window or to insert them into the current window at the location of your choice.

Options
Click to open the Record Window Declarations Options dialog box, which lets you customize settings for the default tag, identifier, and the recording dialog box. For additional information, see Record Window Declarations Options dialog.
Close
Click to close the dialog box. If you have pasted declarations into a file, Silk Test Classic displays the editing window that contains your declarations.

Window declaration list box

The Window declaration list box displays the declarations you have recorded. The GUI hierarchy shows the class, identifier, and tag of the recorded object and its child (subordinate) objects. The declarations for child objects are embedded within the declaration of the parent (superior) object and are shown indented in the list box.

Press Ctrl+Alt to pause tracking - press these hotkeys to freeze the Record Window Declarations dialog box and capture the contents of the current window. The object that the mouse is over when you press Ctrl+Alt is selected in the Window declaration list box and the tag information of that object is displayed in the Window detail area.

To modify the declaration of an object displayed in the list box, select it. The class, identifier, and tag of the selected object are displayed in the Window detail area, where you can edit this information.

By default, custom objects of class CustomWin are shown in red on color monitors (bold on black-and-white monitors). This highlighting serves as a visual reminder for you to map the class of custom objects to a standard class supported by Silk Test Classic. Also, by default, custom objects of class Ignore are not included in the declarations. To change the default behaviors, click Options.