Getting SysLink Text

Applies to TestComplete 14.61, last modified on April 22, 2021

While testing SysLink controls, you can use specific properties and methods of the corresponding program object to perform certain actions and obtain data stored in controls. You can call these methods and properties from your keyword tests, as well as from scripts. This topic describes how to work with the needed properties and methods from your scripts. However, when testing a control from your keyword test, you can use the same methods and properties calling them from keyword test operations. For more information, see Keyword Tests Basic Operations.

To get the text displayed in the Win32 SysLink control, use the wText property of the Win32SysLink object. TestComplete associates this object with all SysLink controls whose class names are listed in the Object Mapping options of your project.

Below is an example that demonstrates how you can get the text displayed in the SysLink control located on the About Windows window (to invoke this window, select Help | About Windows from the main menu of the Windows Explorer):

JavaScript, JScript

function main()
{
  var SysLink;
    
  // Obtain the SysLink control
  SysLink= Sys.Process("Explorer").Window("#32770", "About Windows", 1).Window("SysLink", "", 1);
    
  // Get the text
  Log.Message(SysLink.wText);
}

Python

def Main():
    
  # Obtain the SysLink control
  SysLink= Sys.Process("Explorer").Window("#32770", "About Windows", 1).Window("SysLink", "", 1)
    
  # Get the text
  Log.Message(SysLink.wText)

VBScript

Sub main
  Dim SysLink
    
  ' Obtain the SysLink control
  Set SysLink= Sys.Process("Explorer").Window("#32770", "About Windows", 1).Window("SysLink", "", 1)
     
  ' Get the text
  Log.Message SysLink.wText
End Sub

DelphiScript

procedure main;
var SysLink;
begin
  
  // Obtain the SysLink control
  SysLink := Sys.Process('Explorer').Window('#32770', 'About Windows', 1).Window('SysLink', '', 1);
       
  // Get the text
  Log.Message(SysLink.wText);
end;

C++Script, C#Script

function main()
{
  var SysLink;
    
  // Obtain the SysLink control
  SysLink = Sys["Process"]("Explorer")["Window"]("#32770", "About Windows", 1)["Window"]("SysLink", "", 1);
  
  // Get the text
  Log.Message(SysLink["wText"]);
}

See Also

Working With SysLink Controls
wText Property (SysLink Controls)

Highlight search results