Working with Tables

Working with Tables

testRigor drastically simplifies the process of working with tables. Let’s look at the example below:

# Id Name Actions Additional Data
Filter by
101 york1 Yorktown Arrive Cancel
102 spk2 Spock Listen to Ignore
103 nyo3 Nyota Open channel Promote
Refer to table cells by the intersection of the row and column and produce the value of the first cell in a row and the value of the header or top cell in the column. Let’s click on Open Channel:
click table "Actions" at row "103" and column "Actions"
You can also specify row by saying that row should contain a certain value. This way testRigor will check all values at every row to find a match. For example, for the same table above, and command:
click table "Actions" at row containing "spk2" and column "Actions"
will result in a click on the first action “Listen to”. To click on the second action “Ignore” you can leverage our context feature:
click "Ignore" in the context of table "Actions" at row containing "spk2" and column "Actions"
You can also work with multiline headers by referring to them wither “header” word:
enter "york1" into first table at the second header row and column "Id"
testRigor supports tables for all kinds of operations including but not limited to: validations (checks), clicks, hover, entering data (enter … into), drag and drop, etc. Examples:
check that table "Actions" at row "102" and column "Name" contains "Spock"
check that table "Actions" at row "101" and column "Additional Data" has value "Looks like a trap"
enter "This is a trap!" into table "Actions" at row "101" and column "Additional Data"
click "Open channel" within the context of second table at row "103" and column "Actions"
check that the second table at row containing "Nyota" and column "Actions" contains link "Open channel"
click the first button within the context of second table at row containing "Nyota" and column "Actions"

Keep in mind that there are many different types of tables, and at some point you might need to deal with some which are internally not a table but look like one.

If that’s the case and the test fails – you should use relative locations instead.

Q: For the table above, specify clicking on “Ignore” button using relative locations.

Test your knowledge

click “Listen to” next to table “Actions” at row “spk2” and column “Actions”
click “Listen to” below “Listen to” within table “Actions”
click “Listen to” near the context of table “Actions” at row “spk2”
click “Listen to” within the context of table “Actions” at row containing “spk2” and column “Actions”
click “Listen to” inside table “Actions” after “spk2”

enter into table at second row “Id”
enter into first table at the second header “Id”
enter “text” into the first table at the second header row and column “Id”
enter into first table under the header “Id” at row two
enter “Id” into the second header of the first table

enter “This is easy” into table “Actions” at row “103” and column “Additional Data”
enter “This is easy” into table “Actions” in last row and column
type “This is easy” into “Actions” table in last row and column “Additional Data”
enter “This is easy” into first table under header “Additional Data”

[wpcode id=”1112380″ answers=”4;3;1″ page=”Working with Tables” numoffields=”3″]