POWERBUILDER I Creating Modules
The creation of Modules is described in general in the Tosca Commanderâ„¢ Manual
Screen identification
A screen context serves to identify a business screen of an application to be tested. This should be unique at the time of execution. The following identification methods for the screen context exist:
Name |
Description |
Caption |
This method is the standard method to identify screen contexts. The screen is identified by the title of the window (WindowText). You can also use wildcards. Example: Caption=Tricentis Ange* |
Name |
The screen context is identified by using the PowerBuilder class name of the window. |
ClassName |
If the ClassName is specified, the general Windows ClassName is used to identify the screen context. |
Wildcards can be used in the TechnicalID of screens.
Caption=*werBuild* instead of: Caption=PowerBuilder TestWindow |
Control identification
There are controls that are outside a DataWindow and controls that are inside a DataWindow.
All controls have a WindowHandle of their own and can be identified with Win32 properties.
Controls that are inside Data Windows (DWSubControls) can only be steered via the property Name.
To scan the SubControls of DataWindows, select the option Scan all items in Tosca Wizard under Options->Scanning.
Technical control identification
The technical identification of a control depends on whether a control is located inside or outside a DataWindow.
DataWindows
DataWindows are mainly identified by the property Name. Additionally, all Powerbuilder properties can be used. Several properties can be specified, separated by semicolons.
Syntax: |
<Property>=<Value>;<Property2>=<Value>;etc |
The properties Name, height and ClassName are used for identification along with the values specified below: Name=dw_mydatawindow;height=315;ClassName=pbdw80 |
Technical IDs for Powerbuilder controls are selected or entered via the Technical Identifier table in Tosca Wizard.
-
If a CheckBox in front of an attribute is selected, the attribute which should be used as the TechnicalID is specified. All controls generally get their technical ID via the attribute Name.
The attribute ObjectIndex excludes the combination with other attributes. |
- To be able to change the value of an attribute, double click in the row of the desired attribute of the Value column. A value can then be written in the field. The value of the Index column is also edited. Only numerical values may be entered here.
These values are specified by the Tosca Wizard and must only be modified in special cases. |
-
The plus and minus buttons below the Technical Identifier window allow a customized attribute to be added or deleted.
-
The current definition of the TechnicalID is displayed in the field below the plus and minus buttons. This definition is copied and transferred to the Module.
Example: <Property>=<Value>;\;ClassName=<Value>;Index=<Value>
Tosca Wizard - Technical identification DataWindow
Controls outside DataWindows
These are identified typically by the ClassName or the Name.
Tosca Wizard - Technical identification
Controls inside of DataWindows
Controls in DataWindows (DWSubcontrols) are technically identified via the name of the DataWindow, the name of the control and the specified row.
This name differs from the property Name of controls outside of DataWindows and looks as follows:
Name=dw_form;\;name=controlName;\;row=42 |
Additionally, any DataWindow properties can be specified for identification. Properties of DataWindows are separated by semicolons ; instead of delimiters ;\;.
Name=dw_mytable;verticalscrollmaximum=724;\;name=firstname;\;row=8 |
An index can also be used to clearly identify the DataWindow.
Name=dw_mytable;verticalscrollmaximum=724;Index=3;\;name=firstname;\;row=8 In this example, the third DataWindow with the name dw_mytable and the property verticalscrollmaximum=724 is found. Only after this DataWindow is found is a search performed for a control with the name firstname in the eighth row. |
Since each DataWindow represents a separate subcontext, the name of the DataWindow is required for identification. Since DWSubcontrols are always only unique within their View, it is indispensable to also indicate the row.
Please note that control names are case-sensitive.
If controls are steered, the first step is to search for the DataWindow via the name. If two DataWindows have similar names (for instance dw_form and dw_formal), i.e. if one name is part of the other one, the wrong DataWindow is possibly found. In order to avoid that, an Exact Match Delimiter (<) can be attached to the name of the DataWindow.
dw_form< |
The name of a DataWindow to be searched must thus entirely match the name of this DataWindow.
The setting
Wildcards can be used in the TechnicalID of controls.
The value of the property Name shall contain the character string e_out. The surrounding characters are arbitrary. Name=*e_out* instead of: Name=sle_output |
Control type |
Technical ID |
||
PBCommandButton |
1 |
Caption |
The control is identified by its WindowCaption. |
2 |
Name |
This is the PowerBuilder class name of the control. Although this method of identification is unique, it is very slow in comparison to the Caption method. |
|
3 |
ClassName |
If you specify the ClassName, the general Windows ClassName is used to identify the screen context. |
|
4 |
Text |
The control is recognized by its WindowText. |
|
|
|||
PBCheckBox PBComboBox PBEditBox PBGenericControl PBLabel PBListBox PBListView PBRadioButton PBTabControl PBRTE PBToolBarControl PBTreeView |
1 |
Name |
|
2 |
ClassName |
|
|
|
|||
PBDWRadiobutton PBDWEditBox PBDWComboBox PBDWCheckBox |
1 |
Name + Row |
The control is identified by its name and the row. (see Illustration "Composition of the name property") |
2 |
A combination of properties of the SubControl |
The control is identified by a combination of properties. Example:Name=dw_myDataWindow;\;x=4;y=4 The system searches for a control in the DataWindow dw_myDataWindow, which has the coordinates 4;4. The reference to the DataWindow is important in finding the control. |
Logical control identification
The technical identification of a control depends on whether a control is located inside or outside a DataWindow.
Controls outside of DataWindows
The PowerBuilder class name is used as logical identification.
Controls inside of DataWindows
If the DataWindow is a form, the name of the control is used as logical name.
OKButton |
If the DataWindow is a table, the name of the control including an index (from index 2) is used as logical name. The index and the control names are specified separated by slashes (/).
Last name Last name/2 Last name/3 |