AddNewAction Method

Description

Creates a new action with the specified script content and adds a call to it from the current action.

Syntax

Visual Basic
Public Function AddNewAction( _
   ByVal Name As String, _
   ByVal Description As String, _
   ByVal ScriptContent As String, _
   ByVal Reusable As Boolean, _
   ByVal ActionPosition As qtActionPosition _
) As Action

Parameters

NameThe name of the new action.
DescriptionA textual description of the action.
ScriptContentA single string containing the VBScript content of the action script. For line breaks, use vbCrLf or Chr(13)+Chr(11).
ReusableIndicates whether the action is set as a reusable action
ActionPosition

Indicates whether to add the call to the new action as the first or last step in the parent action.

Valid values:

qtAtBegining: The beginning of the test or parent action.

qtAtEnd: The end of the test or parent action.

Remarks

  • If the script contains syntax or other errors, the AddNewAction step fails.
  • Using this method, you can add the new action only to the beginning (first step) or end (last step) of the parent action script.

Tip: To add the action to another location in the parent script, add the action to the beginning of the script, then retrieve the parent action script using the GetScript method, modify the script content to place the action call in the required location, and then use the SetScript method to update it.

Example

Add a New Action to the Current Parent Action

See Also

Action Object