DELPHI 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 a test object. This context should be unique at the time of TestCase execution. The screen context is identified by the following identification methods:
-
Caption: This method is the standard method to identify screen contexts. The screen is identified by the characters on the top screen edge (WindowText).
It is also possible to enter a part of a string.
Example: Caption=Tricentis Ange*
-
Window name: The window title (WindowText) can also be entered as follows:
Tricentis Angebotsrechner
or
Window.Caption=Tricentis Angebotsrechner
If only the wildcard is indicated in the TechnicalID, the current window will be used.
-
Process properties: The following syntax is used to identify a screen using the properties of the corresponding process:
Process.<property>=<value>
Possible values are for instance:
-
Process.ModuleFileName="C:\AuT\AuT.exe"
-
Process.ID=7032
- Process.Name=Aut.exe
-
-
Window properties: The following syntax is used to identify a screen using the window properties:
Window.<property>=<value>
The following properties can be used. The specific values are intended only as examples:
-
Window.Caption=abc
-
Window.ClassName=abc
-
Window.ExtendedStyles=327936
-
Window.Handle=123456
-
Window.OwnerWindowHandle=123456
-
Window.Styles=123456
-
Window.ParentMDIHandle=123456
-
Window.Top=123456
-
Window.Left=123456
-
Window.Bottom=123456
-
Window.Right=123456
-
Window.Width=123456
-
Window.Height=123456
-
Window.<any technical property of the target window>=yyy
A query for any technical properties of the window only searches for windows that correspond to the process indicated in the Module parameter ProcessName.
-
There are some other rules that apply to screen identification:
-
If the TechnicalID is empty, but the Module parameter ProcessName has been set, the first window found with the specified process is used.
-
The TechnicalID can be comprised of several process and/or window parameters. Each one must be separated with a semicolon ;.
-
If at least one process parameter exists in the TechnicalID, only windows belonging to specified process are searched.
-
If the TechnicalID only contains window parameters, all currently available windows are searched (regardless of the process).
-
The first window that meets all conditions is used as the target window.
abc;Window.Name=Form1 This finds a window with the title abc and the (internal) name Form1. |
Process.Name=Aut.exe;Window.Name=Form1;Window.Top=256 This finds a window that belongs to a process of the name Aut.exe, has the internal name Form1 and is located on the screen in position Top=256. |
Wildcards can be freely used in the TechnicalID of screens.
.Caption=*Ange* instead of: .Caption=Tricentis Angebotsrechner |
When a Delphi application is scanned, all controls and derived controls are identified as described in chapter "DELPHI I Steering controls".
Control identification
When scanning a Delphi application, the entire window is always scanned. The function Scan Region is not supported (see chapter "How to scan a specific region"). Controls other than Delphi controls are labeled as <NotADelphiControl> and displayed as non-selectable.
A technical description or a logical name is assigned to each element. Technical identification in all controls is effected primarily via the .Name-Property. If a control cannot be clearly identified using the .Name-Property or if the .Name-Property is a space, the .Caption-Property is assigned as the Technical ID.
Wildcards can be used in the TechnicalID of controls only if they are combined with LeftMatch.
.Name=But* instead of .Name=Button2 .Name=*2* is not possible |
In addition to the .Name-Property, it is possible to specify any properties, separated by a semicolons.
.<Property-Name1>=<Property-Value1>;.<Property-Name2>=<Property-Value2> |
If a .Parent-Property is indicated, the Technical ID specifies the controls that are directly or indirectly subordinate to a control.
.Parent.<Property-Name3>=<Property-Value3> |
When the delimiter < is entered, the comparison refers to the indicated text by taking the text length into account. If the wildcard * is indicated at the end, the text left to the wildcard is verified. This verification is not case sensitive.
.~<Property-Name1>=<Property-Value1> |
In most cases, the property Name is assigned as the logical name for a control.
If an EditBox has been identified as .Name=Edit1, the logical name suggested is Edit1. |
For the control DelphiGroupBox, the value of the property Caption is used as the logical name.