ReplaceAPITest Method
Supported in versions 23.4 and later.
Description
Replaces an external API test called from the current action with another API test.
Syntax
Visual Basic |
---|
Public Function ReplaceAPITest( _ ByVal oldAPITestName As String, _ ByVal newAPITestPath As String, _ ) |
Parameters
oldAPITestName | The name of the API test called from the current action. |
newAPITestPath | The path to the new external API test to be called from the current action. |
Remarks
This method is valid only for GUI tests.
Example
Dim qtApp
Dim test1
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = true
test1 = "C:\allMethods\AOM\_Resources\Tests\GUIWithAPITest1"
qtApp.Open test1
'Replace the ExistingAPITest test called from the first action with another API test
qtApp.Test.Actions(1).ReplaceAPITest "ExistingAPITest", "C:\AllMethods\AOM\_Resources\ExternalAPITest"
'Replace the ExistingAPITest test called from Action1 with another API test
qtApp.Test.Actions("Action1").ReplaceAPITest "ExistingAPITest", "C:\AllMethods\AOM\_Resources\ExternalAPITest"
qtApp.Quit
See Also