GetContentsOfWindow Function (ConsoleClass)

Class

ConsoleClass.

Action

Returns the contents of the console.

Availability

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

Syntax

lsContents = Console.GetContentsOfWindow (sItemIdentifier)
Variable Description
lsContents The console contents. LIST OF STRING.
sItemIdentifier The index of the console window or the caption of the window. If this parameter is left blank, Silk Test Classic returns the contents of the first found console window. STRING

Notes

  • Each string in the returned list of strings corresponds to one row in the console.

Example 1

The following sample shows how you can use the index to define that you want to get the contents of the second console window:
lsContents = Console.GetContentsOfWindow(2)

Example 2

The following sample shows how you can use the full identifier of a console window to get the contents of the console window:
lsContents = Console.GetContentsOfWindow("C:\\Windows\\system32\\cmd.exe[1]")