Table Operations

Commands for interacting with tables.


Table Format

Table Commands expect a standard HTML table structure. A table with a different structure will need to be handled by a custom Madcow Operation plugin.

<table>
    <thead>
        <th></th>
    </thead>
    <tbody>
        <tr>
            <td></td>
        </tr>
    </tbody>
</table>

Before Using an Operation - Select a Row

Before performing any *.table.currentRow.* operation on a table you must first use the *.table.selectRow command to select the row, this then enables performing table commands on the selected row using the *.table.currentRow.* syntax.

Table Select Row

Operation to select a row for the HTML table, this allows subsequent table commands to reference this row using the currentRow syntax.

Usage

[MADCOW:htmlElementReference].table.selectRow = [columnName1 : 'columnValue1', columnName2 : 'columnValue2']

Examples

#Select the row where the 'country' column equals 'New Zealand'
searchResultsTable.table.selectRow = [country : 'New Zealand']

#Select the row where 'country' equals 'Australia' and 'state' equals 'Queensland'
searchResultsTable.table.selectRow = [country : 'Australia', state : 'Queensland']

Special Row Selection Syntax

When selecting a row, there a some of special keywords that Madcow will recognise, and process differently. These can be used to select a particular row without having to know (or care about) the contents of any given cell.

First

Select the first row in a table - first
myTable.table.selectRow = first

Last

Select the last row in a table - last
myTable.table.selectRow = last

Row(number)

Select a row by its row number - row{n} - where {n} is the number of the row (1 being the first row from the top, 2 being the next, etc).
myTable.table.selectRow = row3

Special Column Selection Syntax

When operating on a column within a given table row, there are some special keywords that Madcow will recognise and process differently. These can be used to operate on a column without having to know (or care) about the title.

First Column

Select the first column for the current row in a table - firstColumn

myTable.table.currentRow.clickLink = 'firstColumn'
myTable.table.currentRow.checkValue = ['firstColumn' : 'some value']
myTable.table.currentRow.value = ['firstColumn' : 'some value']

Last Column

Selects the last column for the current row in a table - lastColumn

myTable.table.currentRow.clickLink = 'lastColumn'
myTable.table.currentRow.checkValue = ['lastColumn' : 'some value']
myTable.table.currentRow.value = ['lastColumn' : 'some value']

Column(number)

Selects a given column by its column number - column{n} where {n} is the number of the column (1 being the first column from the left, 2 being the next, etc).

myTable.table.currentRow.clickLink = 'column1'
myTable.table.currentRow.checkValue = ['column3' : 'some value']
myTable.table.currentRow.value = ['column5' : 'some value']