Table
This chapter describes how to steer tables with Tosca TBox. You can find examples of common use cases at the end of this topic. For detailed information on how to edit tables via the Table Steering Editor, please refer to chapter "Edit tables with the table steering editor".
You can use the following ActionModes to steer columns, rows and cells in tables:
ActionMode |
Value |
Description |
---|---|---|
<value> |
Entering a value |
|
Verify |
<value>, <property> |
Verifying a value or a property |
Constraint |
<value> |
This restricts the search |
<buffer name>, <property>-><buffer name> |
Buffer the value of a cell, row, or column. |
|
Exclude |
{TableCompare} |
This excludes rows and columns from the baseline comparison. |
Moreover, you use the ActionMode Select to select the table.
Spaces, tabs and line breaks will be ignored during value comparisons if the ActionMode Constraint is used in a table. |
For cells, the ActionMode Input can only be used with the value CLICK. To use any other Input value for cells, you have to create embedded controls. |
In addition to the general properties, you can verify the following properties:
Property |
Description |
Available for |
---|---|---|
ColumnCount |
Number of columns in the table. |
table |
RowCount |
Number of rows in the table. |
table |
ColumnNumber |
Index of the selected column. The value for a header column is 0 and the index for the remaining columns is relative to this column. |
column |
RowNumber |
Index of the selected row. The value for a header row is 0 and the index for the remaining rows is relative to this row. |
row |
RawColumnNumber |
Index of the selected column. It always starts at 1. |
column |
RawRowNumber |
Index of the selected row. It always starts at 1. |
row |
ResultCount |
Use this property to verify the number of cells with the specified content within a row or a column. Note the following:
|
row, column |
In this example, you create a Module from following table:
Table example You then create the TestStep Table Properties to verify all table properties successfully.
Verification of every table property |
Table structure
The Table control consists of <Col> and <Row> attributes. Each row or column may contain several <Cell> attributes.
Structure of a table
Rows, columns and cells must be specified by using the name of the corresponding attribute. By doing so, the attribute name will be modified. Values in cells are specified via the Value column. The following options are available for identifying cells:
Table attribute |
Description |
---|---|
Baseline |
Indicates that the table control contains a baseline (see chapter "Table Compare"). |
<Row> |
Possible values for identifying rows:
The prefix $ steers a row in relation to its header. To steer a row based on its absolute position in a table, use the prefix #. |
<Col> |
Possible values for identifying columns:
The prefix $ steers a column in relation to its header. To steer a row based on its absolute position in a table, use the prefix #. |
<Cell> |
Possible values for identifying cells that are available within a row or column attribute:
The prefix $ steers a cell in relation to a header. To steer a cell based on its absolute position in a row or column, use the prefix #. |
In this example, you create a Module from the following table:
Table example You then create the TestStep Table Attributes to successfully verify some of the attributes.
Verification of different table attributes |
Defining headers
Table controls contain the following steering parameters: HeaderColumn and HeaderRow. Tosca XScan automatically identifies and copies them to the Module as a technical ID. The value of these properties specifies the row or column to be used as a header. The header is steered by specifying the value $header.
Table control with steering parameter for headers
Columns that are located before the specified header or column are steered by using negative row or column numbers.
The table below includes examples that illustrate how to steer the according cell via row and column numbers:
|
|
|
|
|
|
$-2, $-2 |
|
|
|
|
$-2, $3 |
|
$-1, $-1 |
|
$-1, $1 |
|
|
|
$header, $-1 |
$header |
$header, $1 |
$header, $2 |
|
|
|
|
$1, $1 |
$1, $2 |
|
$2, $-2 |
|
|
|
|
|
|
|
|
|
|
$3, $3 |
This TestCase steers the table. A click is performed into the header in cell -1.
Steering tables with specified headers |
Note that FirstEmpty and LastContent commands do not work for columns or rows that are located beyond the defined header row or column. |
Defining the value range of cells
Values of cells in a table are copied to the Module as a value range of the parameter ExplicitName. These names are input values for steering and can thus be selected from the drop-down menu of column, row or cell TestStepSubValues (see "Table attributes").
You can use date and time expressions, regular expressions and random values for defining the values.
Value range for rows and columns
Defining controls in cells
Controls can be embedded in the cell of a table to steer the cell. Embedded controls do not require a unique technical ID since these kind of controls are identified via the cell. Control steering however requires that you create a corresponding ModuleAttribute for the respective control type. This applies to the following control types: Button, CheckBox, ComboBox, Link, Image, RadioButton, TextBox, Label and SAP TrafficLight. You can also steer TextBoxes by using cell controls.
-
Select the cell control of a row or column control in the Module.
-
Select Create Embedded <Control-Type> control from the context menu.
Creating an embedded control
For further information on how to steer controls in cells, please refer to the corresponding control chapters.
Controls in a cell
Defining Decisive Columns
Some columns of a table may be entirely filled with standard data such as currency or date values. Cells of these columns however need not contain any relevant data. Columns which contain crucial data are referred to as Decisive Columns in Tosca.
The system can read rows that are filled with concrete values.
Use the parameter DecisiveColumns of a table attribute to define one or more decisive columns. Several values are specified by separating them with semicolons (see "Example 9 - Steering controls with decisive columns").
Parameter DecisiveColumns