DOTNET I Creating Modules

It is possible to steer all Windows.Forms applications which are recognized by the Tosca DotNet Engine during the scan process.

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 their possible uses in the TechnicalID.

Screen identification

A screen context is used for identifying a screen in a test object. The screen context shall be unique at the time of the TestCase execution and is identified by the following methods:

  • Caption: this is the default method to detect screen contexts. The detection of the screen is based on the characters on the top window border (WindowText).

    This technical identification method cannot be combined with other properties.

    Example: Caption=Tricentis Angebotsrechner

  • Screen contexts can alternatively be found via the technical properties if they are unique.

    Example: .Name=Testapplication

Please note that properties are case-sensitive.

Wildcards

Wildcards can be used in the TechnicalID of screens only if they are combined with LeftMatch. Wildcards cannot be used if Caption is used for identifying screens.

.Name=Testa* instead of .Name=Testapplication

Control identification

When a DotNet application is scanned, the Tosca Wizard detects the following elements:

  • System.Windows.Forms.Button

  • System.Windows.Forms.CheckBox

  • System.Windows.Forms.ComboBox

  • System.Windows.Forms.DataGrid

  • System.Windows.Forms.Form

  • System.Windows.Forms.GroupBox

  • System.Windows.Forms.Label

  • System.Windows.Forms.ListBox

  • System.Windows.Forms.ListView

  • System.Windows.Forms.RadioButton

  • System.Windows.Forms.RichTextBox

  • System.Windows.Forms.TabControl

  • System.Windows.Forms.TextBox

  • System.Windows.Forms.ToolBar

  • System.Windows.Forms.TreeView

  • System.Windows.Forms.DataGridView

  • System.Windows.Forms.MenuStrip

  • System.Windows.Forms.OperatorPropertyGrid

  • System.Windows.Forms.ToolStrip

Due to varying DataBindings implementations of controls, customization of the control can be the result.

Technical identification

Each element receives a technical description and a logical name. The technical identification of all controls is primarily based on the property .Name. If a control cannot be uniquely identified by the .Name property, any other property can be additionally specified, separated by a semicolon.

If an application contains controls with identical names, these controls are identified by hierarchically higher (parent) controls. If properties are specified, a leading dot . must be used. If multiple properties are used for the identification, they must be separated by a semicolon ;.

.Name=Button;Parent.Name=frmButtonPanel

Wildcards and regular expressions

Wildcards can be used in the TechnicalID of screens only if they are combined with LeftMatch. The syntax for using regular expressions is as follows:

Syntax:

<Property>=REGEX[<Regular expression>]

The syntax of regular expressions matches the one of .NET Framework.

Wildcards

.Text=MyNewB* instead of .Text=MyNewButton1

Regular expressions

.Text=REGEX[.*Button1$] instead of .Text=MyNewButton1

In case of the controls DotNetPushButton, DotNetRadioButton and DotNetCheckBox, the technical identification may alternatively be based on the .Text property. It is also possible to use Text without a dot as a prefix. Please note that combinations with other properties are thus not possible in this case.

If an application contains controls with the same name, which in turn have properties of the same value, an index will be assigned to these properties.

Assigning index in case of same property value

Both Button controls have the property .Name=IdentButton1. For this purpose, an index is added to the property of the second button found.

.Name=IdentButton1;Index=2

Logical identification

In most cases, the .Name property is assigned as the logical name of the control.

If an EditBox is detected as .Name=txtEditBox, the proposed logical name is txtEditBox.

The controls DotNetCheckBox, DotNetRadioButton and DotNetPushButton use the value of the attribute .Text as the logical name.

Displaying frames

DotNet applications may be organized in frames (GroupBoxes) that contain groups of controls.

GroupBoxes are displayed in the Tosca Wizard as folders:

Application with GroupBox

The included controls are expanded by clicking on the plus symbol to the left of the GroupBox folder.