ManualTestBuilder.Save Method

Applies to TestComplete 14.0, last modified on January 23, 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

The Save method saves the created manual test to a file. You can then add a manual testing project item to your project from this file.

Declaration

ManualTestBuilder.Save(FilePathFailIfExists)

FilePath [in]    Required    String    
FailIfExists [in]    Required    Boolean    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

FilePath

Specifies the path to the file where the created manual test will be saved. The file name is specified by the Name property.

FailIfExists

Specifies whether the method will overwrite the file, whose name coincides with the name of the file, to which the object saves the created manual test. If this parameter is False, the existing file will be overwritten. If the parameter is True, the method will not overwrite the file and will post an error message to the test log.

Result Value

None.

Remarks

If the method was unable to store the manual test to a file, it posts an error message to the test log.

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
ManualTestBuilder.Name Property

Highlight search results