AddSubstep Method

Applies to TestComplete 15.42, last modified on September 08, 2022
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 add a new substep to the step that corresponds to the ManualTestStepObj object.

Declaration

ManualTestStepObj.AddSubstep()

ManualTestStepObj An expression, variable or parameter that specifies a reference to a ManualTestStep object
Result A ManualTestStep object

Applies To

The method is applied to the following object:

Result Value

The method returns the ManualTestStep object that corresponds to the added substep.

Example

The following code snippet creates a manual test and uses the AddSubstep method to add a test step to the root step and to add a substep to the added test step.

JavaScript, JScript

function ManualTest()
{
var RootStep, SubStep;
  // Clears the test properties
  ManualTestBuilder.Reset();
  // Specifies the test name
  ManualTestBuilder.Name = "NewManualTest";
  // Obtains the root step of the manual test and specifies its properties
  RootStep = ManualTestBuilder.Root;

  ...

  // Adds test steps to the root step
  TestStep = RootStep.AddSubstep();

  ...

  // Adds a substep to the test step
  SubStep = TestStep.AddSubstep();

  ...

  // Saves the test to a file
  ManualTestBuilder.Save("C:\\Work Folder\\ManualTest\\", false);

}

Python

def ManualTest():
  # Clears the test properties 
  ManualTestBuilder.Reset()
  # Specifies the test name 
  ManualTestBuilder.Name = "NewManualTest";
  # Obtains the root step of the manual test and specifies its properties 
  RootStep = ManualTestBuilder.Root;
  # Adds test steps to the root step
  TestStep = RootStep.AddSubstep()
  # Adds a substep to the test step
  SubStep = TestStep.AddSubstep()
  # Saves the test to a file 
  ManualTestBuilder.Save("C:\\Work Folder\\ManualTest\\", False)

VBScript

Sub ManualTest

  ' Clears the test properties
  ManualTestBuilder.Reset
  ' Specifies the test name
  ManualTestBuilder.Name = "NewManualTest"
  ' Obtains the root step of the manual test and specifies its properties
  Set RootStep = ManualTestBuilder.Root

  ...

  ' Adds test steps to the root step
  Set TestStep = RootStep.AddSubstep

  ...

  ' Adds a substep to the test step
  Set SubStep = TestStep.AddSubstep

  ...

  ' Saves the test to a file
  Call ManualTestBuilder.Save("C:\Work Folder\ManualTest\", False)

End Sub

DelphiScript

procedure ManualTest();
var RootStep, SubStep;
begin
  // Clears the test properties
  ManualTestBuilder.Reset;
  // Specifies the test name
  ManualTestBuilder.Name := 'NewManualTest';
  // Obtains the root step of the manual test and specifies its properties
  RootStep := ManualTestBuilder.Root;

  ...

  // Adds test steps to the root step
  TestStep := RootStep.AddSubstep;

  ...

  // Adds a substep to the test step
  SubStep := TestStep.AddSubstep;

  ...

  // Saves the test to a file
  ManualTestBuilder.Save('C:\Work Folder\ManualTest\', false);

end;

C++Script, C#Script

function ManualTest()
{
var RootStep, SubStep;
  // Clears the test properties
  ManualTestBuilder["Reset"]();
  // Specifies the test name
  ManualTestBuilder["Name"] = "NewManualTest";
  // Obtains the root step of the manual test and specifies its properties
  RootStep = ManualTestBuilder["Root"];

  ...

  // Adds test steps to the root step
  TestStep = RootStep["AddSubstep"]();

  ...

  // Adds a substep to the test step
  SubStep = TestStep["AddSubstep"]();

  ...

  // Saves the test to a file
  ManualTestBuilder["Save"]("C:\\Work Folder\\ManualTest\\", false);

}

See Also

Creating Manual Tests From Scripts

Highlight search results