QCUtil Object
Description
The object used to access the ALM Open Test Architecture (OTA) interface. You can use the properties associated with the QCUtil object to return ALM OTA objects. You can use the returned object to perform any OTA property or method supported for that object.
For details on the objects, properties, and methods supported for the returned objects exposed by the QCUtil object, see the ALM Open Test Architecture API Reference.
Note: This object replaces the TDUtil object used in earlier versions of QuickTest. The TDUtil object is supported for backwards compatibility only. We recommend updating your tests to use the QCUtil object.
Properties
Run | Returns the ALM OTA Run object, which represents the current run. |
CurrentTest | Returns the ALM OTA Test object, which represents a planning test. |
CurrentTestSet | Returns the ALM OTA TestSet object, which represents a group of tests. |
CurrentTestSetTest | Returns the ALM OTA TSTest object, which represents an execution instance. |
IsConnected | Indicates whether UFT One is currently connected to an ALM project. |
QCConnection | Returns the ALM OTA QCConnection object, which represents the current ALM session and provides access to the ALM object model. |
Run Property
Description
Returns the ALM OTA Run object, which represents the current run. For more details, see the ALM Open Test Architecture API Reference.
Note: This property is supported only when UFT One is connected to Quality Center, version 7.5 or later or ALM, and the run results location is a Quality Center or ALM location.
Syntax
QCUtil.CurrentRun
Return Value
An ALM OTA Run object.
This example returns the current test run results and reports the ALM run name to the UFT One run results.
dim CurrentRun
set CurrentRun = QCUtil.CurrentRun
Reporter.ReportEvent 2,"Current Run", CurrentRun.Name
CurrentTest Property
Description
Returns the ALM OTA Test object, which represents a planning test. For more details, see the ALM Open Test Architecture API Reference.
Note: This property is supported only when UFT One is connected to ALM and the test is saved in an ALM project
Syntax
QCUtil.CurrentTest
Return Value
An ALM OTA Test object.
This example returns the planning test and reports its name to the run results.
dim CurrentTest
set CurrentTest = QCUtil.CurrentTest
Reporter.ReportEvent 2,"Current Test", CurrentTest.Name
CurrentTestSet Property
Description
Returns the ALM OTA TestSet object, which represents a group of tests. For more details, see the ALM Open Test Architecture API Reference.
Note: This property is supported only when UFT One is connected to ALM and the run results location is an ALM location.
Syntax
QCUtil.CurrentTestSet
Return Value
An ALM OTA TestSet object.
This example returns the test set of the current test run and reports its name to the run results.
dim CurrentTSTest
set CurrentTSTest = QCUtil.CurrentTestSet
Reporter.ReportEvent 2,"Current TestSet", CurrentTSTest.Name
CurrentTestSetTest Property
Description
Returns the ALM OTA TSTest object, which represents an execution instance. For more details, see the ALM Open Test Architecture API Reference.
Note: This property is supported only when UFT One is connected to ALM.
Syntax
QCUtil.CurrentTestSetTest
Return Value
An ALM OTA TSTest object.
This example returns the execution test and reports its name to the run results.
Dim CurrentTSTestSet
set CurrentTSTestSet = QCUtil.CurrentTestSetTest
Reporter.ReportEvent 2,"Current TestSet Test", CurrentTSTestSet.Name
IsConnected Property
Description
Indicates whether UFT One is currently connected to an ALM project.
Note: Returns False if UFT One is connected to an ALM server, but not connected to any project.
Tip: We recommend inserting a IsConnected step before other ALM operations.
Syntax
QCUtil.IsConnected
Return Value
Boolean
This example checks whether UFT One is currently connected to an ALM project. If it is, then it reports information about the current server, project, and domain name to the run results. Otherwise it reports a message that UFT One is not connected to ALM.
if QCUtil.IsConnected then
Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.QCConnection.ServerName + chr (13) +"Project: " + QCUtil.QCConnection.ProjectName + chr (13) + "Domain: " + QCUtil.QCConnection.DomainName
else
Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center"
end if
QCConnection Property
Description
Returns the ALM OTA QCConnection object, which represents the current ALM session and provides access to the ALM object model.
For more details, see the ALM Open Test Architecture API Reference.
Note: This property is supported only when UFT One is connected to ALM.
Syntax
QCUtil.QCConnection
Return Value
An ALM OTA QCConnection object.
This example reports a defect to the ALM database and enters values for the Status, Summary and Detected By fields.
Dim QCConnection
Set QCConnection = QCUtil.QCConnection
'Get the IBugFactory
Set BugFactory = QCConnection.BugFactory
'Add a new, empty defect
Set Bug = BugFactory.AddItem (Nothing)
'Enter values for required fields
Bug.Status = "New"
Bug.Summary = "New defect"
Bug.DetectedBy = "admin" ' user that must exist in the database's user list
'Post the bug to the database ( commit )
Bug.Post
See also:
- Crypt Object
- DataTable Object
- Description Object
- DeviceReplay Object
- DotNetFactory Object
- DTParameter Object
- DTSheet Object
- Environment Object
- Extern Object
- Parameter Object
- JSON Object
- JsonUtil Object
- MercuryTimers Object (Collection)
- MercuryTimer Object
- NV Object
- OptionalStep Object
- ParallelUtil Object
- LocalParameter Object
- PasswordUtil Object
- PathFinder Object
- PDFUtil Object
- Properties Object (Collection)
- QCUtil Object
- RandomNumber Object
- Recovery Object
- Remote Connection Object
- Reporter Object
- RepositoriesCollection Object
- Repository Object
- Services Object
- Setting Object
- SystemMonitor Object
- TestArgs Object
- TextUtil Object
- UIAutomation Object
- VisualRelation Object
- VisualRelations Object
- VisualRelationsCollection Object
- WebUtil Object
- XMLUtil Object