ManualTests Object

Applies to TestComplete 15.64, last modified on May 16, 2024
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 ManualTests object allows you to manage manual tests stored in the ManualTests project item from your scripts. This object is only available if your project contains the ManualTests project item.

The ManualTests object contains properties that correspond to manual tests added to the ManualTests collection. The property names coincide with those of the manual test items. Each property returns a ManualTesting object that corresponds to an appropriate manual test. For example, the following code provides access to the manual test named ManualTest1:

JavaScript, JScript

var ManualTestItem1 = ManualTests.ManualTest1;

Python

ManualTestItem1 = ManualTests.ManualTest1

VBScript

Set ManualTestItem1 = ManualTests.ManualTest1

DelphiScript

var
  ManualTestItem1: OleVariant;
begin
  ManualTestItem1 := ManualTests.ManualTest1;
end;

C++Script, C#Script

var ManualTestItem1 = ManualTests.ManualTest1;

Members

The ManualTests object also contains a number of read-only properties whose names have the mtsa prefix. These properties are used to obtain integer constant values that can be assigned to the ManualTestingStepEventParams.StepActions property in a manual testing event handler. By assigning the properties’ values to the ManualTestingStepEventParams.StepActions property, you can change the default processing actions for a test step event that was generated during the manual test execution.

Each of the properties returns an integer value that specifies the action to be performed as a result of a manual test step event:

Property Value Description
mtsaDefault 0 Default processing.
mtsaShowFailDialog 1 Can be used in any manual testing event. Commands TestComplete to show the Step Failure dialog and consider the step as failed.
mtsaStop 2 Can be used in the OnBeforeStep, OnStepFail and OnStepSuccess event handlers. Commands TestComplete to stop the test execution after the event is processed.
mtsaRetry 4 Can be used in the OnStepFail, OnTestStop or OnStepSuccess event handler. Commands TestComplete to execute the current step once again.
mtsaContinue 8 Can be used in the OnStepFail event handler. Specifies that TestComplete should continue the test execution regardless of the step result.
mtsaFail 16 The same as mtsaShowFailDialog. Can be used in the OnStepSuccess and OnTestStop event handlers. Commands TestComplete to consider the test as failed regardless of the actual step result.
mtsaSkip 32 Can be used in the OnBeforeStep event handlers. Commands TestComplete to skip the current step.

Example

The following code demonstrates how you can use the ManualTests.mtsaStop property in the OnStepFail event handler. When a manual test step fails, TestComplete checks whether the step’s id is STEP_4 and, if so, stops the test execution.

JavaScript, JScript

function GeneralEvents_OnStepFail(Sender, StepParams)
{  
  if (StepParams.StepID = "STEP_2")               
    StepParams.StepActions = ManualTests.mtsaStop;
}

Python

def GeneralEvents_OnStepFail(Sender, StepParams):
  if StepParams.StepID == "STEP_2":               
     StepParams.StepActions = ManualTests.mtsaStop

VBScript

Sub GeneralEvents_OnStepFail(Sender, StepParams)
  If StepParams.StepID = "STEP_4" Then                
    StepParams.StepActions = ManualTests.mtsaStop
  End If
End Sub

DelphiScript

procedure GeneralEvents_OnStepFail(Sender: OleVariant, StepParams: OleVariant);
begin
  if (StepParams.StepID = 'STEP_2') then              
    StepParams.StepActions := ManualTests.mtsaStop;
end;

C++Script, C#Script

function GeneralEvents_OnStepFail(Sender, StepParams)
{  
  if (StepParams["StepID"] = "STEP_2")               
    StepParams["StepActions"] = ManualTests["mtsaStop"];
}

See Also

ManualTesting Object

Highlight search results