-
Notifications
You must be signed in to change notification settings - Fork 2
Madcow Operations Table
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 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.
Operation to select a row for the HTML table, this allows subsequent table commands to reference this row using the currentRow syntax.
[MADCOW:htmlElementReference].table.selectRow = [columnName1 : 'columnValue1', columnName2 : 'columnValue2']
#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']
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.
Select the first row in a table - first
myTable.table.selectRow = first
Select the last row in a table - last
myTable.table.selectRow = last
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
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.
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']
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']
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']
Click one of the following links for more information about a given Madcow table operation!
- Home
- Setting Up
- Configuration
- Writing Madcow Tests
- Running Madcow Tests
- Data Parameters
- Templates
- Macros
- Disabling A Test
- Spreadsheet Scenario Testing
Madcow Operations
- Madcow Operations
- Madcow Operations - Table
- Madcow Operations - XPath Extras
- List of Madcow Operations
Extending and Customising Madcow
Reference
For Developers