StepActions Property

Applies to TestComplete 15.47, last modified on January 20, 2023
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 testing engine generates a number of manual testing events. Use the StepActions property to change the default processing actions for a step's event that was generated.

Declaration

ManualTestingStepEventParamsObj.StepActions

Read-Write Property Integer
ManualTestingStepEventParamsObj An expression, variable or parameter that specifies a reference to a ManualTestingStepEventParams object

Applies To

The property is applied to the following object:

Property Value

An integer value that specifies the action to be performed. You can use any combination of the following constants:

Constant 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 snippet is an event handler for the OnStepFail event. When a manual test step fails, the code gets the ManualTestingStepEventParams object, obtains the ID of the failed step and specifies what actions should be performed.

JavaScript, JScript

function GeneralEvents_OnStepFail(Sender, StepParams)
{
  // Obtains the step ID
  var ID = StepParams.StepID;

  // Specifies the actions to be performed
  switch (ID)
  {
    case "STEP_L":
          StepParams.StepActions = ManualTests.mtsaRetry // Execute the test step once again
          break;
    case "STEP_M":
          StepParams.StepActions = ManualTests.mtsaSkip // Skip the current test step
          break;
    case "STEP_N":
          StepParams.StepActions = ManualTests.mtsaStop // Stop the test execution
          break;
  }

}

Python

def GeneralEvents_OnStepFail(Sender, StepParams):
  # Obtains the step ID 
  ID = StepParams.StepID # Specifies the actions to be performed
  if ID == "STEP_L":
    StepParams.StepActions = ManualTests.mtsaRetry 
    # Execute the test step once again
  elif ID == "STEP_M":
    StepParams.StepActions = ManualTests.mtsaSkip
    # Skip the current test step
  elif ID == "STEP_N":
    StepParams.StepActions = ManualTests.mtsaStop 
    # Stop the test execution

VBScript

Sub GeneralEvents_OnStepFail(Sender, StepParams)

  ' Obtains the step ID
  ID = StepParams.StepID

  ' Specifies the actions to be performed
  Select Case ID
    Case "STEP_L" StepParams.StepActions = ManualTests.mtsaRetry ' Execute the test step once again
    Case "STEP_M" StepParams.StepActions = ManualTests.mtsaSkip ' Skip the current test step
    Case "STEP_N" StepParams.StepActions = ManualTests.mtsaStop ' Stop the test execution
  End Select

End Sub

DelphiScript

procedure GeneralEvents_OnStepFail(Sender, StepParams);
var ID;
begin
  // Obtains the step ID
  ID := StepParams.StepID;

  // Specifies the actions to be performed
  case ID of
    'STEP_L' : StepParams.StepActions := ManualTests.mtsaRetry; // Execute the test step once again
    'STEP_M' : StepParams.StepActions := ManualTests.mtsaSkip; // Skip the current test step
    'STEP_N' : StepParams.StepActions := ManualTests.mtsaStop; // Stop the test execution
  end;

end;

C++Script, C#Script

function GeneralEvents_OnStepFail(Sender, StepParams)
{
  // Obtains the step ID
  var ID = StepParams["StepID"];

  // Specifies the actions to be performed
  switch (ID)
  {
    case "STEP_L":
          StepParams["StepActions"] = ManualTests.mtsaRetry // Execute the test step once again
          break;
    case "STEP_M":
          StepParams["StepActions"] = ManualTests.mtsaSkip // Skip the current test step
          break;
    case "STEP_N":
          StepParams["StepActions"] = ManualTests.mtsaStop // Stop the test execution
          break;
  }

}

See Also

Manual Testing
Executing Manual Tests
About Manual Test Editor
Manual Testing Events

Highlight search results