ReplaceAPITest Method

Supported in versions 23.4 and later.

Description

Replaces an external API test called from the current test with another API test.

Syntax

Visual Basic
Public Function ReplaceAPITest( _
   ByVal oldAPITestName As String, _
   ByVal newAPITestPath As String, _
)

Parameters

oldAPITestNameThe name of the API test called from the current test.
newAPITestPathThe path to the new external API test to be called from the current test.

Remarks

This method is valid only for GUI tests.

Example

Replacing the API test called from the test with another API test

Copy code
Dim qtApp
Dim test1

Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = true    

test1 = "C:\allMethods\AOM\_Resources\Tests\GUIWithAPITest"
qtApp.Open test1

'Replace an API Test called by the test with another API test
qtApp.Test.ReplaceAPITest "Test_AddExistingAPITest", "C:\AllMethods\AOM\_Resources\ExternalAPITest"

qtApp.Quit

See Also