Table

This chapter describes how to steer tables with Tosca TBox. At the end of this chapter you can find examples of common use cases. For detailed information on how to edit tables via the Table Steering Editor, please refer to chapter "Editing tables with the Table Steering Editor".

The following ActionModes can be used to steer columns, rows and cells in tables:

ActionMode

Value

Description

Input

<value>

Entering a value

Verify

<value>, <property>

Verifying a value or a property

Constraint

<value>

This restricts the search

Buffer

<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.

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.

The following properties can be verified in addition to the general 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

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 attributes

Table attribute

Description

Baseline

Indicates that the Table control contains a baseline (see chapter "Baseline comparison").

<Row>

Possible values for identifying rows:

  • Row name: the available names are defined via the header (see "Defining headers").

  • $1: this steers the first row of the table

  • $<n>: row number using a dollar sign as a prefix

    The value <n> must be replaced by a row number. The header is steered via the value $header.

  • $last: this steers the last row of the table

  • $header: this steers a cell in the table header

  • $lastContentRow: this steers the last table row which includes a value.

  • $firstEmptyRow: this steers the first table row which does not include a value.

  • Rows can also be identified by specifying a cell value in the Value column.

<Col>

Possible values for identifying columns:

  • Column name: the available names are defined via the header (see "Defining headers").

  • $1: this steers the first column of the table

  • $<n>: column number using a dollar sign as a prefix

    The value <n> must be replaced by a column number.

  • $last: this steers the last column of the table

<Cell>

Possible values for identifying cells that are available within a row or column attribute, depending on the used context.

  • Column name: the available names are defined via the header (see "Defining headers").

  • $1: this steers the first cell of the table

  • $<n>: row or column number using a dollar sign as a prefix

    The value <n> must be replaced by a row or column number.

  • Cell values can also be specified in the Value column.

  • $last: this steers the last cell of the row or column

  • $header: this steers a cell in the table header

  • $lastContentRow: this steers the last table row which includes a value.

  • $firstEmptyRow: this steers the first table row which does not include a value.

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

Please 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 "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. TextBoxes can also be steered by using cell controls.

  1. Select the cell control of a row or column control in the Module.

  2. 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