Skip to content

Madcow Operations Table

timfarr edited this page May 15, 2011 · 19 revisions

Madcow Operations - Table Functions

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>

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

searchResultsTable.table.selectRow = [country : 'New Zealand']

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

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

There are two special values that simplify selecting the first or last column in a table.

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']

Clone this wiki locally