WIN32 I Creating Modules

The creation of Modules is described in general in the Tosca Commander™ Manual (see chapter "Scan classic Modules with Legacy Scan"). In the chapters below you will be provided with engine specific methods for identifying screens and controls as well as a list of properties and wildcards and their possible uses in the TechnicalID.

Screen identification

A screen context is used to identify a business-based screen in a test object. It should be unique when the test case is executed.

The screen context can be identified by the following identification method:

  • Caption: This is the default method to recognize screen contexts. The screen is identified by the characters at the top of the window (WindowText).

    It is possible to enter a partial string.

    Example: Caption=Tricentis Produc*

  • ClassName: When ClassName is specified, the general Windows classname is used to identify the screen context.

Wildcards

Wildcards can be freely used in the TechnicalID of screens.

Caption=*tis Ange* instead of Caption=Tricentis Angebotsrechner

Scanning windows

When a window is scanned with Tosca Wizard, all controls that were found are displayed in the TreeView of Tosca Wizard.

Controls that could not be identified are marked with the icon . By clicking the button a dialog window is opened. The correct steering class for the selected control can be chosen here (see Illustration "Select steering class").

Select steering class

Thus the class name of the control is assigned to the corresponding steering class. The class name is automatically entered in the file WinClassMappings.dat under the respective steering class.
After a restart of Tosca Wizards the control is identified correctly.

If the class name of the window to be scanned has not been added to the WinClassMappings.dat file yet, a message will pop up upon scanning, prompting whether the window should be added. The window must be added so that it is identified correctly upon steering.

Add class neme of the window to WinClassMapping.dat

ChildWindow identification

The Tosca Win32 Engine allows to steer one specific ChildWindow via its TechnicalID.

Syntax:

<MainWindow>;\;<ChildWindow>;\;<ChildChildwindow> ...

The individual class names of the ChildWindows must be specified in the file WinClassMappings.dat. The class names can be read via the Tosca Wizard by activating the option Show application info in Tosca Wizard’s View menu .

To steer the child window Edit2 in UltraEdit, the following TechnicalID is used: Caption=UltraEdit*;\;Caption=Edit2

Control identification

There are different types of control recognition:

  • WindowCaption: For this recognition method the text of a window is obtained via the API function GetWindowText.

  • ObjectIndex: All controls of a particular automation type (EditBox, ComboBox,…) are numbered according to the sequence of their appearance on the screen. This method is generally instable, as the sequence can change frequently, even though the mask does not change visually.

  • Caption: For this recognition method the text of a window is obtained via the API function GetWindowText.

  • Label: For this recognition type a label is searched that is located in the surrounding of a control.

  • TricentisRectangle: For this recognition type a rectangle is drawn over a control with the coordinates from the left upper and the bottom left corner. When the control is located within this rectangle it is recognized. This method has restrictions due to possible differences in screen resolutions.

The same screen and client coordinate settings must be applied for the scanning and the steering.

  • Text: If a control has a text (PushButton, RadioButton, CheckBox), this text can be used for the identification. To recognize the text optically by OCR, the setting UseOCR must be activated (see table "UseOCR").

  • Win32Name: For this recognition type the Tosca VB6 object recognition is used. For the object recognition static recognition criteria (internal names of controls defined by the developer) are used to identify all Win32 controls.

  • Win32Tag: Similar to the steering by Win32Name the Tosca VB6 object recognition is used. Instead of the .name property the .tag property is used.

  • DialogID: This recognition type is used for controls in PROGRESS surroundings, because of the fixed widget-IDs, which can be used for marking. This widget-ID is read via the DialogID and used for steering the control.

Wildcards

Wildcards can be used in the TechnicalID of controls.