If you are testing dynamic HTML tables, you may need to retrieve the row or column index from a table during playback to use in the GetControlFromTable statement. QA Wizard Pro includes the following statements for finding row and column indexes in HTML tables:
FindColumnByRowIndex
Searches an HTML table row to locate a cell or control in a cell that matches property values and returns the column index of the cell.
Window("WindowName").Control("ControlName").FindColumnByRowIndex(SearchRowIndex, "PropertyName", "ExpectedValue", ...)
FindRowByColumnIndex
Searches an HTML table column to locate a cell or control in a cell that matches property values and returns the row index of the cell.
Window("WindowName").Control("ControlName").FindRowByColumnIndex(SearchColIndex, "PropertyName", "ExpectedValue", ...)
Note: If the control is not found, -1 is returned as the index value.
In the following example, the document ID is stored in a variable named ID. The FindRowByColumnIndex statement finds the row index of the cell in the List table in the Documents window that contains an Inner Text property value that matches the value of the ID variable. The row index is stored in a variable named ROWINDEX, which is used in the Click statement to indicate the row index of the cell that includes the hyperlink to click.
ID = Cell("D")
ROWINDEX = Window("Documents").HTMLTable("List").FindRowByColumnIndex(1, "Inner Text", ID)
Window("Documents").HTMLLink(Window("Documents").HTMLTable("List"). GetControlFromTable("HTMLLink", ROWINDEX, 2)).Click()