ManualTestBuilder Object

Applies to TestComplete 14.30, last modified on November 21, 2019
The manual testing functionality is deprecated. Do not use it for creating new tests. It will be removed in a future TestComplete release.

Description

Using the ManualTestBuilder object you can create manual tests from scripts. The ManualTestBuilder object is available if the Manual Test Builder plugin is installed in TestComplete.

Members

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
  Dim RootStep, TestStep

  ' 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

Manual Testing
Creating Manual Tests From Scripts
TestComplete Helper Objects

Highlight search results