ManualTestBuilder.Name Property

Applies to TestComplete 14.92, last modified on September 16, 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 property to specify the name of the manual test that you are creating with the ManualTestBuilder object.

The test name will be used to refer to the test from scripts, so the name must be a valid identifier. Different scripting languages use different naming concepts. To create the name that will meet the requirements of any supported scripting language, start the name with a letter and use only letters, digits or underscore symbols in it.

The Name property also defines the name of the file where the test will be saved, so this name must be a valid file name.

Declaration

ManualTestBuilder.Name

Read-Write Property String

Applies To

The property is applied to the following object:

Property Value

A string specifying the test name.

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
Save Method

Highlight search results