GetFormattedText Function

Class

HtmlColumn, HtmlList, and HtmlTable.

Action

Returns the text of the entire list, column, or table, formatted as closely to what appears on the screen as possible.

Availability

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

Syntax

lsText = object.GetFormattedText()
Variable Description
lsText The text in the entire list, column, or table. LIST OF STRING.

Notes

Silk Test Classic considers the first row of a table to be the column title, regardless of whether or not there is a column title tag in the table structure.

GetFormattedText returns the following formatting information:

  • Line endings as they are in the page as currently viewed.
  • For unordered lists the function returns the ASCII representations for bullets, "*", "o", or "#", depending on which bullet character is displayed in the list.
  • For ordered lists the function returns numbers or letters, depending on which the list is displaying for the ordering.
  • Indenting for nested lists.

Example

This example uses the list of used technologies in the About This Site page of the GMO Web application.

LIST OF STRING lsText
lsText = AboutPage.UsedList.GetFormattedText()
ListPrint(lsText)

// Result:
// * HTML 3.2
// * HTML Browser Extensions
// * Animation
// * JavaScript
// * CGI
// * Java
// * ActiveX
// * Client-side processes
// * Server-side processes