Setting SysLink Text

Applies to TestComplete 14.10, last modified on June 5, 2019

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 set the text displayed in the 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. wText specifies the string that is displayed in the SysLink control. The link’s text is enclosed within the <a>...</a> tags.

Below is an example that demonstrates how you can set 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);
    
  // Set the text
  SysLink.wText = "Text <a> Link </a> "
}

Python

def Main():
    
  # Obtain the SysLink control
  SysLink = Sys.Process("Explorer").Window("#32770", "About Windows", 1).Window("SysLink", "", 1)
    
  # Set the text
  SysLink.wText = "Text <a> Link </a> "

VBScript

Sub main
  Dim SysLink
    
  ' Obtain the SysLink control
  Set SysLink= Sys.Process("Explorer").Window("#32770", "About Windows", 1).Window("SysLink", "", 1)
     
  ' Set the text
  SysLink.wText = "Text <a> Link </a> "
End Sub

DelphiScript

procedure main;
var SysLink;
begin
  
  // Obtain the SysLink control
  SysLink := Sys.Process('Explorer').Window('#32770', 'About Windows', 1).Window('SysLink', '', 1);
       
  // Set the text
  SysLink.wText := 'Text <a> Link </a> ';
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);
  
  // Set the text
  SysLink["wText"] = "Text <a> Link </a> ";
}

See Also

Working With SysLink Controls
wText Property (SysLink Controls)

Highlight search results