GetStepInfo Method

Applies to TestComplete 14.71, last modified on April 22, 2021
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 obtain information about a manual testing step.

Declaration

ManualTestingObj.GetStepInfo(StepID)

ManualTestingObj An expression, variable or parameter that specifies a reference to a ManualTesting object
StepID [in]    Required    String    
Result The ManualTestingStepInfo object

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

StepID

Specifies the identifier of the desired step (this identifier is shown in the ID field of the Manual Testing editor).

Result Value

The method returns the ManualTestingStepInfo object which provides information about the desired step.

Example

The following example obtains information on a test step and posts the information to the test log.

JavaScript, JScript

function GetInfoSample()
{
  // Specifies the test step ID
  var ID = "STEP_K";

  // Obtains information on the test step
  var Info = ManualTests.NewManualTest.GetStepInfo(ID);
  // Obtains the step’s caption
  var Caption = Info.GetCaption();
  // Obtains the step description and notes
  var PostInfo = "Description: " + Info.GetDescription() + "\r\n" +
              "Notes: " + Info.GetNotes() + "\r\n"
  // Determines the format in which the step data is stored
  if (Info.IsXMLContent())
    PostInfo = PostInfo + "The data is stored in the XML file: " + Info.GetInstructionsXML() + "\r\n" +
               "Applied XSL file: " + Info.GetInstructionsXSL();
  else
    PostInfo = PostInfo + "Data is stored in the HTML file: " + Info.GetInstructionsURL();

  // Posts the step information to the test log
  Log.Message(Caption, PostInfo);

}

Python

def GetInfoSample():
  # Specifies the test step ID
  ID = "STEP_K"
  # Obtains information on the test step
  Info = ManualTests.NewManualTest.GetStepInfo(ID)
  # Obtains the step's caption
  Caption = Info.GetCaption()
  # Obtains the step description and notes
  PostInfo = "Description: " + Info.GetDescription() + "\r\n" + "Notes: " + Info.GetNotes() + "\r\n"
  # Determines the format in which the step data is stored
  if Info.IsXMLContent():
    PostInfo = PostInfo + "The data is stored in the XML file: " + Info.GetInstructionsXML() + "\r\n" + "Applied XSL file: " + Info.GetInstructionsXSL()
  else:
    PostInfo = PostInfo + "Data is stored in the HTML file: " + Info.GetInstructionsURL()
  # Posts the step information to the test log
  Log.Message(Caption, PostInfo)

VBScript

Sub GetInfoSample

  ' Specifies the test step ID
  ID = "STEP_K"

  ' Obtains information on the test step
  Set Info = ManualTests.NewManualTest.GetStepInfo(ID)
  ' Obtains the step’s caption
  Caption = Info.GetCaption
  ' Obtains the step description and notes
  PostInfo = "Description: " & Info.GetDescription & VbCrLf & _
              "Notes: " & Info.GetNotes & VbCrLf
  ' Determines the format in which the step data is stored
  If Info.IsXMLContent Then
    PostInfo = PostInfo & "The data is stored in the XML file: " & Info.GetInstructionsXML & VbCrLf & _
               "Applied XSL file: " & Info.GetInstructionsXSL
  Else
    PostInfo = PostInfo & "The data is stored in the HTML file: " & Info.GetInstructionsURL

  End If
  ' Posts the step information to the test log
  Call Log.Message(Caption, PostInfo)

End Sub

DelphiScript

procedure GetInfoSample();
var ID, Info, Caption, PostInfo;
begin
  // Specifies the test step ID
  ID := 'STEP_K';

  // Obtains information on the test step
  Info := ManualTests.NewManualTest.GetStepInfo(ID);
  // Obtains the step’s caption
  Caption := Info.GetCaption();
  // Obtains the step description and notes
  PostInfo := 'Description: ' + Info.GetDescription + #13#10 +
              'Notes: ' + Info.GetNotes + #13#10;
  // Determines the format in which the step data is stored
  if Info.IsXMLContent then
    PostInfo := PostInfo + 'The data is stored in the XML file: ' + Info.GetInstructionsXML() + #13#10 +
               'Applied XSL file: ' + Info.GetInstructionsXSL()
  else
    PostInfo := PostInfo + 'The data is stored in the HTML file: ' + Info.GetInstructionsURL();

  // Posts the step information to the test log
  Log.Message(Caption, PostInfo);

end;

C++Script, C#Script

function GetInfoSample()
{
  // Specifies the test step ID
  var ID = "STEP_K";

  // Obtains information on the test step
  var Info = ManualTests["NewManualTest"]["GetStepInfo"](ID);
  // Obtains the step’s caption
  var Caption = Info["GetCaption"]();
  // Obtains the step description and notes
  var PostInfo = "Description: " + Info["GetDescription"]() + "\r\n" +
              "Notes: " + Info["GetNotes"]() + "\r\n"
  // Determines the format in which the step data is stored
  if (Info["IsXMLContent"]())
    PostInfo = PostInfo + "The data is stored in the XML file: " + Info["GetInstructionsXML"]() + "\r\n" +
               "Applied XSL file: " + Info["GetInstructionsXSL"]();
  else
    PostInfo = PostInfo + "The data is stored in the HTML file: " + Info["GetInstructionsURL"]();

  // Posts the step information to the test log
  Log["Message"](Caption, PostInfo);

}

See Also

Manual Testing
Executing Manual Tests
Manual Testing Events
ManualTestingStepInfo Object

Highlight search results