Description
An object that enables you to manage the Quality Center connection and retrieve the TDOTA object, which provides full interaction with
Quality Center.
Examples
Methods
Connect Connects QuickTest to the Quality Center
project.
Properties
Domain The Quality Center domain to which QuickTest is currently connected.
SupportVersionControl Indicates whether the Quality Center server to which QuickTest is connected supports
version control.
TDOTA Returns a TDOTA object, which exposes the Quality Center API and provides full
interaction with Quality Center.
User The user that is currently connected to Quality Center.
Connect Method
Description
Syntax
Argument Description
UserName Required. A String value. The user name for opening the
specified project.
Return Value
None
Disconnect Method
Description
object.Disconnect
Argument Description
Return Value
None
Examples
Domain Property
Description
Syntax
object.Domain
Argument Description
object An expression evaluating to an object of type
TDConnection.
Value Type
Read-only. A String value.
Project Property
Description
Syntax
object.Project
Argument Description
Value Type
Read-only. A String value.
Server Property
Description
Syntax
object.Server
Argument Description
Value Type
Read-only. A String value.
SupportVersionControl Property
Description
Indicates whether the Quality Center server to which QuickTest is connected supports version control.
Syntax
object.SupportVersionControl
Argument Description
Value Type
Read-only. A Boolean value.
Possible Values
Examples
TDOTA Property
Description
Returns a TDOTA object, which exposes the Quality Center API and provides full interaction with Quality Center.
Syntax
object.TDOTA
Argument Description
TDOTA Object
Description
Using the Quality Center Open Test Architecture (previously TDOTA), you can integrate your own requirement and configuration
management tools, defect tracking tools, third-party and custom tools, and modeling applications.
You can:
• Remotely execute tests in your testing application on multiple hosts across a network and analyze the test results
from within the Quality Center environment.
• Use the Quality Center COM-based API to enable your application to create, retrieve, and update Quality Center
project records from within your test application environment.
For more information, refer to the Mercury Quality Center Open Test Architecture API Reference, which is supplied with your Quality
Center package.
User Property
Description
Syntax
object.User
Argument Description
Value Type
Read-only. A String value.
RunResultsOptions Object
Description
Remarks
After setting the property values for a RunResultsOptions object, you can use the object as an argument in a Test.Run or Test.UpdateRun
statement.
Examples
Properties
ResultsLocation The path in which the run results will be
stored.
ResultsLocation Property
Description
Syntax
object.ResultsLocation [= value]
Argument Description
Value Type
Read-write. A String value.
Possible Values
• A specific file system folder path in which you want to save the results for the current test or component.
When working with a test in the file system or when running a component from QuickTest, the test results are saved
in <QuickTest installation folder>\Tests\<TestName\<ResX>, where ResX is a unique folder name under the
test folder.
When working with a test in Quality Center, the results are saved using the values from the TDRunName,
TDTestInstance, and TDTestSet properties.
This option corresponds to the top radio button in the Run dialog box.
• <TempLocation>--saves the run results in the <System Drive>\Temp\TempResults temporary results folder.
This overwrites any results previously saved in this folder.
This option corresponds to the bottom radio button in the Run dialog box.
Remarks
If no value is specified for the the ResultsLocation property, or the property value is an empty string, then the results are saved using the
same settings as the previous test run.
The folder must be new, empty, or contain only QuickTest test or component files.
Examples
TDRunName Property
Description
Syntax
object.TDRunName [= value]
Argument Description
object An expression evaluating to an object of type
RunResultsOptions.
Value Type
Read-write. A String value.
TDTestInstance Property
Description
Syntax
object.TDTestInstance [= value]
Argument Description
Value Type
Read-write. A Long value.
TDTestSet Property
Description
Syntax
object.TDTestSet [= value]
Argument Description
Value Type
Read-write. A String value.
Run Method
Description
Runs the open test or business component and creates results in the specified file or Quality Center path.
Syntax
Argument Description
Note: Set this property to False only if the steps following the
Test.Run statement can be performed even while the test or
component is running.
Parameters Optional. A Parameters object. The Parameters
collection containing the values you want to pass to the
test or component.
Return Value
None
Remarks
Note: When you run a test or business component using automation, it always runs in silent mode (whether QuickTest is visible or
minimized). This means that that even if QuickTest is visible, message boxes are not opened during the run session.
Examples
Run a Test for a Specified Number of Iterations | Supply the Values of the Test Parameters for a Test Run
Parameters Collection
Description
Examples
Properties
Count The number of Parameter objects in the collection.
UpdateRun Method
Description
Syntax
Argument Description
Return Value
None
'****************************************************************************************************************
********
'Description:
'
'This example connects to a Quality Center project, opens a test (checks it out, if applicable),
'updates the Active Screen values and test object descriptions, and, if applicable,
'checks the modified test back into the Quality Center project.
'
'Assumptions:
'The test1 test is not already checked out.
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'When QuickTest opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'****************************************************************************************************************
********
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtUpdateRunOptions 'As QuickTest.UpdateRunOptions ' Declare an Update Run Options object variable
Dim qtRunResultsOptions 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
Dim blsSupportsVerCtrl ' Declare a flag for indicating version control support
'****************************************************************************************************************
********
'Description:
'
'This example opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'When QuickTest opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'****************************************************************************************************************
********
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
Run a Test for a Specified Number of Iterations
'****************************************************************************************************************
********
'Description:
'
'This example opens a test, configures run options and settings,
'runs the test, and then checks the results of the test run.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'When QuickTest opens, it loads the add-ins required for the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'****************************************************************************************************************
********
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt 'As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False
Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = "C:\Tests\Test1\Res1" ' Set the results location
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
'****************************************************************************************************************
********
'Description:
'
'This example opens a test with predefined parameters,
' gets a collection of parameter definitions, Loops on it and display each parameter details,
' gets a collection of run-time parameters, change the value of one of them, run the test with parameters,
' after the test run - display the value of one of the out parameters.
'
'Assumptions:
' the test D:\Tests\Mytest contain in parameter called "InParam1" and out parameter called "OutParam1"
'****************************************************************************************************************
********
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim pDefColl 'As QuickTest.ParameterDefinitions ' Declare a Parameter Definitions collection
Dim pDef ' As QuickTest.ParameterDefinition ' Declare a ParameterDefinition object
Dim rtParams 'As QuickTest.Parameters ' Declare a Parameters collection
Dim rtParam ' As QuickTest.Parameter ' Declare a Parameter object
'Dim cnt, Indx As Integer
qtApp.Open "D:\Tests\MyTest"
cnt = pDefColl.Count
Indx = 1
' Display the names and values of each of the parameters in the collection.
While Indx <= cnt
Set pDef = pDefColl.Item(Indx)
MsgBox "Param name: " & pDef.Name & "; Type: " & pDef.Type & "; InOut: " & pDef.InOut & "; Description: " _
& pDef.Description & "Default value: " & pDef.DefaultValue
Indx = Indx + 1
Wend
Set rtParams = pDefColl.GetParameters() ' Retrieve the Parameters collection defined for the test.
qtApp.Test.Run , True, rtParams ' Run the test with changed parameters.
MsgBox rtParams.Item("OutParam1").Value ' Display the value of an output parameter after the test runs.