InstructionsText Property

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 the InstructionsText property to specify the instruction's text for the ManualTestStep step. Using this property you can assign the instruction's text directly from a script without passing a file that contains the text. The instructions are displayed using the font and font size that is specified in the Manual Test | General Options section of the Default Project Properties dialog.

When the InstructionsText property is assigned with a value, TestComplete automatically creates a new HTML file and writes instructions to it. Since the HTML format is used to store data, make sure that the object’s IsXMLContent property is not set to True. (This property is False by default.)

Declaration

ManualTestStepObj.InstructionsText

Read-Write Property String
ManualTestStepObj An expression, variable or parameter that specifies a reference to a ManualTestStep object

Applies To

The property is applied to the following object:

Property Value

A plain-text string holding the step instructions.

Remarks

The instructions usually occupy more than one line. To specify a string that contains multiple text lines you should use one or more special characters that depend on the scripting language used. For instance, the new line symbol in VBScript is vbNewLine, in JavaScript, JScript, C#Script, C++Script, Python it is \r\n combination and in DelphiScript it is denoted as #13#10. For further information on special textual characters refer to the Working With Strings topic

To define step instructions that are contained in an existing HTML file, use the InstructionsURL property.

To define step instructions that are contained in an existing XML file, you should specify both the XMLFileName and XSLFileName properties.

Example

The following example demonstrates how to specify the text of test step instructions.

JavaScript, JScript

function ManualTest()
{
  ManualTestBuilder.Reset();
  ManualTestBuilder.Name = "NewManualTest";
  // Obtains the root step of the test and specifies its properties
  var RootStep = ManualTestBuilder.Root;
  RootStep.Caption = "Root step of my item";

  // Specifies the format of the file storing step instructions
  RootStep.IsXMLContent = false;
  // Specifies the text holding the test instructions
  RootStep.InstructionsText = "Test step instructions";

  // Adds new substeps to the root step and specifies their properties
  ...

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

}

Python

def ManualTest():
  ManualTestBuilder.Reset()
  ManualTestBuilder.Name = "NewManualTest"
  # Obtains the root step of the test and specifies its properties
  RootStep = ManualTestBuilder.Root
  RootStep.Caption = "Root step of my item"
  # Specifies the format of the file storing step instructions
  RootStep.IsXMLContent = False
  # Specifies the text holding the test instructions
  RootStep.InstructionsText = "Test step instructions"
  # Adds new substeps to the root step and specifies their properties
  # ...
  # Saves the created test to a file
  ManualTestBuilder.Save("C:\\Work Folder\\ManualTest\\", True)

VBScript

Sub ManualTest

  ManualTestBuilder.Reset
  ManualTestBuilder.Name = "NewManualTest"
  ' Obtains the root step of the test and specifies its properties
  Set RootStep = ManualTestBuilder.Root
  RootStep.Caption = "Root step of my item"

  ' Specifies the format of the file storing step instructions
  RootStep.IsXMLContent = False
  ' Specifies the text holding the test instructions
  RootStep.InstructionsText = "Test step instructions"

  ' Adds new substeps to the root step and specifies their properties
  ...

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

End Sub

DelphiScript

procedure ManualTest();
var RootStep;
begin
  ManualTestBuilder.Reset;
  ManualTestBuilder.Name := 'NewManualTest';
  // Obtains the root step of the test and specifies its properties
  RootStep := ManualTestBuilder.Root;
  RootStep.Caption := 'Root step of my item';

  // Specifies the format of the file storing step instructions
  RootStep.IsXMLContent := false;
  // Specifies the text holding the test instructions
  RootStep.InstructionsText := 'Test step instructions';

  // Adds new substeps to the root step and specifies their properties
  ...

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

end;

C++Script, C#Script

function ManualTest()
{
  ManualTestBuilder["Reset"]();
  ManualTestBuilder["Name"] = "NewManualTest";
  // Obtains the root step of the test and specifies its properties
  var RootStep = ManualTestBuilder["Root"];
  RootStep["Caption"] = "Root step of my item";

  // Specifies the format of the file storing step instructions
  RootStep["IsXMLContent"] = false;
  // Specifies the text holding the test instructions
  RootStep["InstructionsText"] = "Test step instructions";

  // Adds new substeps to the root step and specifies their properties
  ...

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

}

See Also

Creating Manual Tests From Scripts
InstructionsURL Property
XMLFileName Property
XSLFileName Property
IsXMLContent Property

Highlight search results