GetRowText Function (HtmlTable)

Class

HtmlTable.

Action

Returns the contents of one row in a table.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

lsRowText = table.GetRowText (Row[, bShowSpannedCell])
Variable Description
lsRowText The contents of one row. LIST OF STRING.
Row The row in the table. TABLEROW.
bShowSpannedCell Optional: For tables with cells that span rows or columns, also called "merged cells", when bShowSpannedCell is TRUE, Silk Test Classic treats all the spanned cells as if they contain the same content, and treats the table as a full matrix. It draws invisible "lines" between the cells as if they were not grouped together. bShowSpannedCell defaults to FALSE. See the description of GetRowRangeText for an example of how bShowSpannedCell works. BOOLEAN.

Notes

HTML table column headings are not considered to be table data, and therefore are not returned by GetRowRangeText(). Silk Test Classic always regards the first row as the column name, not as the first row. For example:
column name 1 column name 2 column Name 3
row 1 row 1 row 1
row 2 row 2 row 2
row 3 row 3 row 3
By default, blank cells are ignored. If you are using the DOM extension and want to return blank cells as empty strings (""), set the RowTextIncludesEmptyCells option to TRUE. You can set this option globally in the Options section of the domex.ini file or on a table-by-table basis in your script file through BrowserPage, as shown in the following code sample:
SetUserOption("RowTextIncludesEmptyCells", TRUE)

Example

This example uses the table on the Online Catalog page of the GMO Web application.

LIST OF STRING lsText
lsText = CatalogPage.CatalogTable.GetRowText(4)
Print(lsText)

// Result
// {1003, Padded Socks, $ 19.99, 4}