ManualTestBuilder.Reset Method

Applies to TestComplete 14.72, 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 clear all properties of the created manual test and to delete all created test steps.

Declaration

ManualTestBuilder.Reset()

Result None

Applies To

The method is applied to the following object:

Result Value

None.

Example

The following code snippet demonstrates how to create a new manual test, specify its name, add steps to it and save the test to a file.

JavaScript, JScript

function CreateManualTest()
{
  // Clears the test properties
  ManualTestBuilder.Reset();

  // Specifies the test name
  ManualTestBuilder.Name = "NewManualTest";

  // Creates the root step of the test
  var RootStep = ManualTestBuilder.Root;
  // Specifies the root step properties
  RootStep.ID = "RootStep";
  RootStep.Caption = "Manual Test";
  RootStep.IsXMLContent = false;
  RootStep.InstructionsText = "Click Begin Test";

  ...

  // Adds new substeps and specifies their properties
  var TestStep = RootStep.AddSubstep();
  TestStep.Id = "STEP_1";
  TestStep.Caption = "Step 1";
  TestStep.Enabled = true;
  TestStep.IsXMLContent = false;
  TestStep.InstructionsURL = "C:\\Work Folder\\Manual Tests\\Step1.htm";

  ...

  // Saves the created test to a file
  ManualTestBuilder.Save("C:\\Work Folder\\Manual Tests", true);

}

Python

def CreateManualTest():
  # Clears the test properties
  ManualTestBuilder.Reset()
  # Specifies the test name
  ManualTestBuilder.Name = "NewManualTest"
  # Creates the root step of the test
  RootStep = ManualTestBuilder.Root
  # Specifies the root step properties
  RootStep.ID = "RootStep"
  RootStep.Caption = "Manual Test"
  RootStep.IsXMLContent = False
  RootStep.InstructionsText = "Click Begin Test"
  # Adds new substeps and specifies their properties
  TestStep = RootStep.AddSubstep()
  TestStep.Id = "STEP_1"
  TestStep.Caption = "Step 1"
  TestStep.Enabled = True
  TestStep.IsXMLContent = False
  TestStep.InstructionsURL = "C:\\Work Folder\\Manual Tests\\Step1.htm"
  # Saves the created test to a file
  ManualTestBuilder.Save("C:\\Work Folder\\Manual Tests", True)

VBScript

Sub CreateManualTest

  ' Clears the test properties
  ManualTestBuilder.Reset

  ' Specifies the test name
  ManualTestBuilder.Name = "NewManualTest"

  ' Creates the root step of the test
  Set RootStep = ManualTestBuilder.Root
  ' Specifies the root step properties
  RootStep.ID = "RootStep"
  RootStep.Caption = "Manual Test"
  RootStep.IsXMLContent = False
  RootStep.InstructionsText = "Click Begin Test"

  ...

  ' Adds new substeps and specifies their properties
  Set TestStep = RootStep.AddSubstep
  TestStep.Id = "STEP_1"
  TestStep.Caption = "Step 1"
  TestStep.Enabled = True
  TestStep.IsXMLContent = False
  TestStep.InstructionsURL = "C:\Work Folder\Manual Tests\Step1.htm"

  ...

  ' Saves the created test to a file
  Call ManualTestBuilder.Save("C:\Work Folder\Manual Tests", True)

End Sub

DelphiScript

procedure CreateManualTest();
var RootStep, TestStep;
begin
  // Clears the test properties
  ManualTestBuilder.Reset;

  // Specifies the test name
  ManualTestBuilder.Name := 'NewManualTest';

  // Creates the root step of the test
  RootStep := ManualTestBuilder.Root;
  // Specifies the root step properties
  RootStep.ID := 'RootStep';
  RootStep.Caption := 'Manual Test';
  RootStep.IsXMLContent := false;
  RootStep.InstructionsText := 'Click Begin Test';

  ...

  // Adds new substeps and specifies their properties
  TestStep := RootStep.AddSubstep;
  TestStep.Id := 'STEP_1';
  TestStep.Caption := 'Step 1';
  TestStep.Enabled := true;
  TestStep.IsXMLContent := false;
  TestStep.InstructionsURL := 'C:\Work Folder\Manual Tests\Step1.htm';

  ...

  // Saves the created test to a file
  ManualTestBuilder.Save('C:\Work Folder\Manual Tests', true);

end;

C++Script, C#Script

function CreateManualTest()
{
  // Clears the test properties
  ManualTestBuilder["Reset"]();

  // Specifies the test name
  ManualTestBuilder["Name"] = "NewManualTest";

  // Creates the root step of the test
  var RootStep = ManualTestBuilder["Root"];
  // Specifies the root step properties
  RootStep["ID"] = "RootStep";
  RootStep["Caption"] = "Manual Test";
  RootStep["IsXMLContent"] = false;
  RootStep["InstructionsText"] = "Click Begin Test";

  ...

  // Adds new substeps and specifies their properties
  var TestStep = RootStep["AddSubstep"]();
  TestStep["Id"] = "STEP_1";
  TestStep["Caption"] = "Step 1";
  TestStep["Enabled"] = true;
  TestStep["IsXMLContent"] = false;
  TestStep["InstructionsURL"] = "C:\\Work Folder\\Manual Tests\\Step1.htm";

  ...

  // Saves the created test to a file
  ManualTestBuilder["Save"]("C:\\Work Folder\\Manual Tests", true);

}

See Also

Creating Manual Tests From Scripts

Highlight search results