JAVA I Creating Modules

This chapter describes the Java specific settings to create modules with Tosca Wizard. The general description of how to create modules with Tosca Wizard can be found in the chapter "Scan classic Modules with Legacy Scan".

When modules are created with Tosca Wizard, semicolons ; in Technical IDs must be escaped with a leading slash /, so that the complete expressions are saved. Consequently, slashes in Technical IDs must also be escaped with a leading slash://.

Wildcards and regular expressions in the TechnicalID

For the identification of controls, Wildcards can be used in the TechnicalID. Regular expressions can also be used in the TechnicalID if combined with the setting"Use regex for ComponentSearch".

Name=.*ditfeld instead of Name=editfeld

Identifying controls via Label search

Controls can be identified on the basis of surrounding labels. For this purpose, the setting Label/Search must be activated and a LabelID must be specified (see setting "Label").

Procedure

The search is carried out for each control in the sequence Label Left, Label Top, Label Right, Label Bottom.

The start position of the search is determined relatively to the Controlposition (upper left corner of the control). The following table shows the individual start positions for the label search:

Start positions for the label search

Label

X coordinate

Y coordinate

Label Left

Controlposition.X - 5 pixels

Controlposition.Y + Control height/2

Label Top

Controlposition.X - 5 pixels

Controlposition.Y - 5 pixels

Label Right

Controlposition.X + Control width + 5 pixels

Controlposition.Y + Control height/2

Label Bottom

Controlposition.X - 5 pixels

Controlposition.Y + Control height + 5 pixels

If no label is found, the start position is moved by 5 pixels along the X-axis (Label Left and Label Right) or along the Y-axis (Label Top and Label Bottom) towards the window border and the search is repeated until a label is found.

If the window border is reached and no label was found, the search is carried out in the next direction.

Label search - procedure

The identified controls are named by Tosca Wizard according to the following syntax:

Syntax:

Label[<Index>].<Position>=<LabelName>

The index indicates the control type next to the label. This index must be specified in any case, even if only one control exists. You can adjust the index value for the directions Top and Bottom.

The text field has the label Label[1].Left=MarkeLabel

Example - Label Left

The text field has the label Label[1].Top=MarkeLabel

Example - Label Top

The upper text field has the label Label[1].Top=MarkeLabel, the bottom one has the label Label[2].Top=MarkeLabel

Example - Label Top with 2 controls

Identifying controls via SWT Datamap ID

SWT controls allow an additional attribute to be specified for control identification.

Enter the value name in the Settings dialog at Settings->Special Engines->JavaEngine->SWT specific->SWT Datamap IDs.

SWT Datamap IDs

After scanning a test object, Tosca Wizard provides the attribute getData(name) for controls. This attribute can be selected for any number of controls and is specified in the TechnicalID.

SWT-Datamap-ID - Tosca Wizard

After the object is scanned again, all controls are identified uniquely.

Identifying controls via the attribute parent

If an application contains controls of the same technical identification, the property parent can be used as an additional identifier. For this purpose, the controls must be located in different frames. To be able to uniquely identify the frames, the following option must be enabled in the Options menu of Tosca Wizard: Scanning->Scan all items.

The parent property is verified bottom-up in the tree structure until a unique identification is possible. The parent property is defined via the parameter TechnicalID of the ObjectControl. Here, the property parent must be specified without a leading dot.

Syntax:

parent.<Property>=<Value>

All available properties are shown in the Control Properties tab of Tosca Wizard.

The current value of the property and the searched value must be identical.

An application contains two Button controls with the same TechnicalID in different frames. The required button is steered via the frame (parent) using the name f1.

SWT Datamap-ID

Identifying controls via propertyindex

If an application contains controls of the same technical identification, the propertyindex can be used as an additional identifier for each property. All available properties are shown in the Control Properties tab of Tosca Wizard.

Syntax:

<Property>=<Value>/;propertyindex=<Index>

In this example, the second button with the TechnicalId Name=button that is found by the engine, should be steered.

TechnicalId with propertyindex