AddExistingAPITest Method

Supported in versions 2021 and later.

Description

Adds a call to an existing API test from the current action.

Syntax

Visual Basic
Public Function AddExistingAPITest( _
   ByVal Path As String, _
   ByVal ActionPosition As qtActionPosition _
) As APITest

Parameters

Path

The full path to the existing API test. It could be a local or ALM path.

ActionPosition

Indicates whether to add the call to the existing API test as the first or last step in the parent action.

ValueDescription
qtAtBeginingThe beginning of the parent action.
qtAtEndThe end of the parent action.

Remarks

Using this method, you can add the existing API test only to the beginning or end of the current action.

Example

Add a call to an existing API test from an action

' Create the application object
Dim qtApp
Set qtApp = CreateObject("QuickTest.Application") 
'Start OpenText Functional Testing
qtApp.Launch
qtApp.Visible = True
test1 = "C:\Tests\GUITest2"
qtApp.Open test1 
apiTestPath = "C:\Tests\APITest2"
'Add a call to an existing API test at the beginning of Action 1
qtApp.Test.Actions("Action1").AddExistingAPITest apiTestPath, 1 ' qtAtBegining = 1
'Add a call to an existing API test at the end of Action 1
qtApp.Test.Actions("Action1").AddExistingAPITest apiTestPath, 2 ' qtAtEnd = 2

See Also

Action Object