GetIconFileName Method

Applies to TestComplete 15.47, last modified on January 20, 2023
The manual testing functionality is deprecated. Do not use it for creating new tests. It will be removed in a future TestComplete release.

Description

Use this method to get the name of the image file that holds the icon displayed in to the left of the step description.

If the default icon is used, the method returns an empty string.

Declaration

ManualTestingStepInfoObj.GetIconFileName()

ManualTestingStepInfoObj An expression, variable or parameter that specifies a reference to a ManualTestingStepInfo object
Result String

Applies To

The method is applied to the following object:

Result Value

A name of the image file with the test step icon.

Example

The following code snippet obtains the name of the image file that holds the test step icon and posts the image to the test log.

JavaScript, JScript

function ManualTestStepInfo()
{

  var ID, Info, Image, Icon;
  // Specifies the test step ID
  ID = "STEP_1";
  // Obtains information on the test step
  Info = ManualTests.NewManualTest.GetStepInfo(ID);
  // Obtains the name of the image file associated with the test step
  Icon = Info.GetIconFileName();

  if (Icon != "")
  {
    Image = Utils.Picture;
    Image.LoadFromFile(Icon);
    Log.Picture(Image, "The image associated with the test step", Icon);
  }
  else
    Log.Message("The default icon is used for the test step");

  ...

}

Python

def ManualTestStepInfo():
  # Specifies the test step ID
  ID = "STEP_1"
  # Obtains information on the test step
  Info = ManualTests.NewManualTest.GetStepInfo(ID)
  # Obtains the name of the image file associated with the test step
  Icon = Info.GetIconFileName()
  if Icon != 0:
    Image = Utils.Picture
    Image.LoadFromFile(Icon)
    Log.Picture(Image, "The image associated with the test step", Icon)
  else: 
    Log.Message("The default icon is used for the test step")

VBScript

Sub ManualTestStepInfo

  ' Specifies the test step ID
  ID = "STEP_1"
  ' Obtains information on the test step
  Set Info = ManualTests.NewManualTest.GetStepInfo(ID)
  ' Obtains the name of the image file associated with the test step
  Icon = Info.GetIconFileName

  If Icon <> "" Then
    Set Image = Utils.Picture
    Image.LoadFromFile(Icon)
    Call Log.Picture(Image, "The image associated with the test step", Icon)
  Else
    Log.Message "The default icon is used for the test step"
  End If

  ...

End Sub

DelphiScript

procedure ManualTestStepInfo();
var ID, Info, Image, Icon;
begin

  // Specifies the test step ID
  ID := 'STEP_1';
  // Obtains information on the test step
  Info := ManualTests.NewManualTest.GetStepInfo(ID);
  // Obtains the name of the image file associated with the test step
  Icon := Info.GetIconFileName();

  if Icon <> '' then
  begin
    Image := Utils.Picture;
    Image.LoadFromFile(Icon);
    Log.Picture(Image, 'The image associated with the test step', Icon);
  end
  else
    Log.Message('The default icon is used for the test step');

  ...

end;

C++Script, C#Script

function ManualTestStepInfo()
{

  var ID, Info, Image, Icon;
  // Specifies the test step ID
  ID = "STEP_1";
  // Obtains information on the test step
  Info = ManualTests["NewManualTest"]["GetStepInfo"](ID);
  // Obtains the name of the image file associated with the test step
  Icon = Info["GetIconFileName"]();

  if (Icon != "")
  {
    Image = Utils["Picture"];
    Image["LoadFromFile"](Icon);
    Log["Picture"](Image, "The image associated with the test step", Icon);
  }
  else
    Log["Message"]("The default icon is used for the test step");

  ...

}

See Also

Manual Testing
Executing Manual Tests
About Manual Test Editor
Manual Testing Events
ManualTesting Object

Highlight search results