Skip to content

Latest commit

 

History

History
 
 

iterate-over-table-rows

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Iterate Over Table Rows

Test Code: index.js

This example shows how to iterate over table rows.

The example page contains a table over which the test code iterates. Select the table and get the total number of rows in it:

const table        = Selector('table');
const dataRows     = table.find('tbody > tr');
const dataRowCount = await dataRows.count;

When dataRowCount is available, the test can iterate over the rows. In the example, the iteration is done in a for loop.

In each row, the test checks the cell where the index is equal to one and whether it contains the text Smith. If the following row is even, the test checks if this row has a checkbox in a checked state.