Indicator Object

Applies to TestComplete 15.42, last modified on September 08, 2022

Description

The Indicator object provides a scripting interface used to change the text or visibility of the TestComplete indicator. For more information on how you can use the Indicator object in your tests, see Using TestComplete Indicator.

Members

Example

The code below demonstrates how you can set, restore and obtain the text that is shown under the indicator's icon.

JavaScript, JScript

function IndicatorDemo()
{
  // Shows the indicator icon
  Indicator.Show();
  // Pushes text to the indicator
  Indicator.PushText("Hello!");
  // Delays the script execution for 2 seconds
  aqUtils.Delay(2000, Indicator.Text);
  
  // Pushes new text to the indicator
  Indicator.PushText("New indicator text.");
  aqUtils.Delay(2000, Indicator.Text);
  
  // Restores the previous indictor text - "Hello!"
  Indicator.PopText();
  aqUtils.Delay(2000, Indicator.Text);
  
  // Clears the history of the indicator's user messages
  Indicator.Clear();
  
  // Hides the indicator icon
  Indicator.Hide();
}

Python

def IndicatorDemo():
  # Shows the indicator icon
  Indicator.Show()
  # Pushes text to the indicator
  Indicator.PushText("Hello!")
  # Delays the script execution for 2 seconds
  aqUtils.Delay(2000, Indicator.Text)
  # Pushes new text to the indicator 
  Indicator.PushText("New indicator text.")
  aqUtils.Delay(2000, Indicator.Text)
  # Restores the previous indictor text - "Hello!"
  Indicator.PopText()
  aqUtils.Delay(2000, Indicator.Text)
  # Clears the history of the indicator's user messages
  Indicator.Clear()
  # Hides the indicator icon
  Indicator.Hide()

VBScript

Sub IndicatorDemo()

  ' Shows the indicator icon
  Indicator.Show()
  ' Pushes text to the indicator
  Indicator.PushText("Hello!")
  ' Delays the script execution for 2 seconds
  Call aqUtils.Delay(2000, Indicator.Text)
  
  ' Pushes new text to the indicator
  Indicator.PushText("New indicator text.")
  Call aqUtils.Delay(2000, Indicator.Text)
  
  ' Restores the previous indictor text - "Hello!"
  Indicator.PopText()
  Call aqUtils.Delay(2000, Indicator.Text)
  
  ' Clears the history of the indicator's user messages
  Indicator.Clear()
  
  ' Hides the indicator icon
  Indicator.Hide()

End Sub

DelphiScript

function IndicatorDemo;
begin

  // Shows the indicator icon
  Indicator.Show;
  // Pushes text to the indicator
  Indicator.PushText('Hello!');
  // Delays the script execution for 2 seconds
  aqUtils.Delay(2000, Indicator.Text);
  
  // Pushes new text to the indicator
  Indicator.PushText('New indicator text.');
  aqUtils.Delay(2000, Indicator.Text);
  
  // Restores the previous indictor text - "Hello!"
  Indicator.PopText;
  aqUtils.Delay(2000, Indicator.Text);
  
  // Clears the history of the indicator's user messages
  Indicator.Clear;
  
  // Hides the indicator icon
  Indicator.Hide;

end;

C++Script, C#Script

function IndicatorDemo()
{
  // Shows the indicator icon
  Indicator["Show"]();
  // Pushes text to the indicator
  Indicator["PushText"]("Hello!");
  // Delays the script execution for 2 seconds
  aqUtils["Delay"]( 2000, Indicator["Text"] );
  
  // Pushes new text to the indicator
  Indicator["PushText"]("New indicator text.");
  aqUtils["Delay"]( 2000, Indicator["Text"] );
  
  // Restores the previous indictor text - "Hello!"
  Indicator["PopText"]();
  aqUtils["Delay"]( 2000, Indicator["Text"] );
  
  // Clears the history of the indicator's user messages
  Indicator["Clear"]();
  
  // Hides the indicator icon
  Indicator["Hide"]();
}

See Also

Using TestComplete Indicator
TestComplete Helper Objects

Highlight search results